Accent color
# Tooltip ## Description Tooltip component briefly describes unlabeled controls or provides a bit of additional information about labeled controls. ## Parameters | Name | Type | Default Value | Description | | :--- | :--- | :------------ | :---------- | | Anchor | `RenderFragment?` | null | Child content of component, the content that the Tooltip will apply to. | | ChildContent | `RenderFragment?` | null | Child content of component, the content that the Tooltip will apply to. | | Classes | `BitTooltipClassStyles?` | null | Custom CSS classes for different parts of the BitTooltip. | | DefaultIsShown | `bool?` | null | Default value of the IsShown. | | HideArrow | `bool` | false | Hides the arrow of tooltip. | | HideDelay | `int` | 0 | Delay (in milliseconds) before hiding the tooltip. | | IsShown | `bool` | false | The visibility state of the tooltip. | | IsShownChanged | `EventCallback<bool>` | | | | Position | `BitTooltipPosition` | BitTooltipPosition.Top | The position of tooltip around its anchor. | | Template | `RenderFragment?` | null | The content you want inside the tooltip. | | Text | `string?` | null | The text of tooltip to show. | | ShowOnClick | `bool` | false | Determines shows tooltip on click. | | ShowDelay | `int` | 0 | Delay (in milliseconds) before showing the tooltip. | | ShowOnFocus | `bool` | false | Determines shows tooltip on focus. | | ShowOnHover | `bool` | true | Determines shows tooltip on hover. | | Styles | `BitTooltipClassStyles?` | null | Custom CSS styles for different parts of the BitTooltip. | | AriaLabel | `string?` | null | Gets or sets the accessible label for the component, used by assistive technologies. | | Class | `string?` | null | Gets or sets the CSS class name(s) to apply to the rendered element. | | Dir | `BitDir?` | null | Gets or sets the text directionality for the component's content. | | ForceAnimation | `bool` | false | Gets or sets a value indicating whether the component's animations play at their full duration even when reduced motion is requested. | | HtmlAttributes | `Dictionary<string, object>` | new Dictionary<string, object>() | Captures additional HTML attributes to be applied to the rendered element, in addition to the component's parameters. | | Id | `string?` | null | Gets or sets the unique identifier for the component's root element. | | IsEnabled | `bool` | true | Gets or sets a value indicating whether the component is enabled and can respond to user interaction. | | Style | `string?` | null | Gets or sets the CSS style string to apply to the rendered element. | | TabIndex | `string?` | null | Gets or sets the tab order index for the component when navigating with the keyboard. | | Visibility | `BitVisibility` | BitVisibility.Visible | Gets or sets the visibility state (visible, hidden, or collapsed) of the component. | ## Public Members | Name | Type | Default Value | Description | | :--- | :--- | :------------ | :---------- | | UniqueId | `Guid` | Guid.NewGuid() | Gets the readonly unique identifier for the component's root element, assigned when the component instance is constructed. | | RootElement | `ElementReference` | | Gets the reference to the root HTML element associated with this component. | ## Enums ### BitTooltipPosition Enum | Name | Value | Description | | :--- | :--- | :---------- | | Top | 0 | The position of tooltip top of its anchor | | TopLeft | 1 | The position of tooltip top left of its anchor | | TopRight | 2 | The position of tooltip top right of its anchor | | RightTop | 3 | The position of tooltip right top of its anchor | | Right | 4 | The position of tooltip right of its anchor | | RightBottom | 5 | The position of tooltip right bottom of its anchor | | BottomRight | 6 | The position of tooltip bottom right of its anchor | | Bottom | 7 | The position of tooltip bottom of its anchor | | BottomLeft | 8 | The position of tooltip bottom left of its anchor | | LeftBottom | 9 | The position of tooltip left bottom of its anchor | | Left | 10 | The position of tooltip left of its anchor | | LeftTop | 11 | The position of tooltip left top of its anchor | ### BitVisibility Enum | Name | Value | Description | | :--- | :--- | :---------- | | Visible | 0 | The content of the component is visible. | | Hidden | 1 | The content of the component is hidden, but the space it takes on the page remains (visibility:hidden). | | Collapsed | 2 | The component is hidden (display:none). | ### BitDir Enum | Name | Value | Description | | :--- | :--- | :---------- | | Ltr | 0 | Ltr (left to right) is to be used for languages that are written from the left to the right (like English). | | Rtl | 1 | Rtl (right to left) is to be used for languages that are written from the right to the left (like Arabic). | | Auto | 2 | Auto lets the user agent decide. It uses a basic algorithm as it parses the characters inside the element until it finds a character with a strong directionality, then applies that directionality to the whole element. | ## Sub Classes ### BitTooltipClassStyles Properties | Name | Type | Default Value | Description | | :--- | :--- | :------------ | :---------- | | Root | `string?` | null | Custom CSS classes/styles for the root element of the BitTooltip. | | TooltipWrapper | `string?` | null | Custom CSS classes/styles for the tooltip wrapper of the BitTooltip. | | Tooltip | `string?` | null | Custom CSS classes/styles for the tooltip of the BitTooltip. | | Arrow | `string?` | null | Custom CSS classes/styles for the arrow of the BitTooltip. | ## Examples \n**Basic**: ```razor Hover over me ``` \n**Position**: ```razor Top Right Left Bottom ``` \n**Custom content**: ```razor Hover over me ``` \n**Advanced**: ```razor Anchor ``` ```csharp private bool isShown = true; private bool showOnClick = true; private bool showOnHover; private bool hideArrow; private double hideDelay = 800; private BitTooltipPosition tooltipPosition; private readonly List> tooltipPositionList = Enum.GetValues(typeof(BitTooltipPosition)) .Cast() .Select(enumValue => new BitDropdownItem { Value = enumValue, Text = enumValue.ToString() }) .ToList(); ``` \n**Styles & Classes**: ```razor Hover over me Hover over me ``` \n**RTL**: ```razor نشانگر ماوس را روی من بیاورید ```