Tooltip
Tooltip component briefly describes unlabeled controls or provides a bit of additional information about labeled controls.
Usage
Basic
Explore the fundamental use of BitTooltip with a simple hover interaction on a BitButton.
This is the tooltip text
Position
You can customize the Tooltip position to enhance the user experience.
Text
Text
Text
Text
Custom content
Here are some examples of customizing the tooltip content.
- 1. One
- 2. Two
Advanced
Here are some examples of advanced usage of tooltip.
Text
Top
Styles & Classes
Empower customization by overriding default styles and classes, allowing tailored design modifications to suit specific UI requirements.
Styles:
This is the tooltip text
Classes:
This is the tooltip text
RTL
Use BitTooltip in right-to-left (RTL).
- ۱. یک
- ۲. دو
API
BitTooltip 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 | false | 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. |
BitComponentBase parameters
Name |
Type |
Default value |
Description |
|---|---|---|---|
| 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. |
| 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. |
BitComponentBase 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. |
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. |
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. |
Feedback
You can give us your feedback through our GitHub repo by filing a new Issue or starting a new Discussion.
Or you can review / edit this page on GitHub.
Or you can review / edit this component on GitHub.
- On this page