You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: blazor/tooltip/accessibility.md
+21-22Lines changed: 21 additions & 22 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -9,20 +9,20 @@ documentation: ug
9
9
10
10
# Accessibility in Blazor Tooltip Component
11
11
12
-
The [Blazor Tooltip](https://www.syncfusion.com/blazor-components/blazor-tooltip) component followed the accessibility guidelines and standards, including [ADA](https://www.ada.gov/), [Section 508](https://www.section508.gov/), [WCAG 2.2](https://www.w3.org/TR/WCAG22/) standards, and [WCAG roles](https://www.w3.org/TR/wai-aria/#roles) that are commonly used to evaluate accessibility.
12
+
The [Blazor Tooltip](https://www.syncfusion.com/blazor-components/blazor-tooltip) component follows accessibility guidelines and standards, including [ADA](https://www.ada.gov/), [Section 508](https://www.section508.gov/), [WCAG 2.2](https://www.w3.org/TR/WCAG22/) standards, and [WAI-ARIA roles](https://www.w3.org/TR/wai-aria/#roles) that are commonly used to evaluate accessibility.
13
13
14
14
The accessibility compliance for the Blazor Tooltip component is outlined below.
15
15
16
16
| Accessibility Criteria | Compatibility |
17
17
| -- | -- |
18
-
|[WCAG 2.2](https://www.w3.org/TR/WCAG22/) Support | <imgsrc="https://cdn.syncfusion.com/content/images/documentation/full.png"alt="Yes"> |
19
-
|[Section 508](https://www.section508.gov/) Support | <imgsrc="https://cdn.syncfusion.com/content/images/documentation/full.png"alt="Yes"> |
20
-
| Screen Reader Support | <imgsrc="https://cdn.syncfusion.com/content/images/landing-page/yes.png"alt="Yes"> |
21
-
| Right-To-Left Support | <imgsrc="https://cdn.syncfusion.com/content/images/landing-page/yes.png"alt="Yes"> |
22
-
| Color Contrast | <imgsrc="https://cdn.syncfusion.com/content/images/landing-page/yes.png"alt="Yes"> |
23
-
| Mobile Device Support | <imgsrc="https://cdn.syncfusion.com/content/images/landing-page/yes.png"alt="Yes"> |
24
-
| Keyboard Navigation Support | <imgsrc="https://cdn.syncfusion.com/content/images/landing-page/yes.png"alt="Yes"> |
@@ -31,37 +31,36 @@ The accessibility compliance for the Blazor Tooltip component is outlined below.
31
31
}
32
32
</style>
33
33
34
-
<div><imgsrc="https://cdn.syncfusion.com/content/images/landing-page/yes.png"alt="Yes"> - All features of the component meet the requirement.</div>
34
+
<div><imgsrc="https://cdn.syncfusion.com/content/images/landing-page/yes.png"alt="Meets requirement"> - All features of the component meet the requirement.</div>
35
35
36
-
<div><imgsrc="https://cdn.syncfusion.com/content/images/documentation/partial.png"alt="Partial"> - Some features of the component do not meet the requirement.</div>
36
+
<div><imgsrc="https://cdn.syncfusion.com/content/images/documentation/partial.png"alt="Partially meets requirement"> - Some features of the component do not fully meet the requirement.</div>
37
37
38
-
<div><imgsrc="https://cdn.syncfusion.com/content/images/landing-page/no.png"alt="No"> - The component does not meet the requirement.</div>
38
+
<div><imgsrc="https://cdn.syncfusion.com/content/images/landing-page/no.png"alt="Does not meet requirement"> - The component does not meet the requirement.</div>
39
39
40
40
## WAI-ARIA attributes
41
41
42
-
The Blazor Tooltip component followed the [WAI-ARIA](https://www.w3.org/WAI/ARIA/apg/patterns/tooltip/)patterns to meet the accessibility. The following ARIA attributes are used in the Tooltip component.
42
+
The Blazor Tooltip component follows the [WAI-ARIA tooltip pattern](https://www.w3.org/WAI/ARIA/apg/patterns/tooltip/) to meet accessibility requirements. The following ARIA attributes are used in the Tooltip component.
43
43
44
44
| Attributes | Purpose |
45
45
| --- | --- |
46
-
| role=”tooltip”| The element that serves as the container for the Tooltip has the ARIA role of `tooltip`. |
47
-
| aria-describedby | This attribute is added to the target element on which the Tooltip gets opened, when focusing or hovering over it. It usually holds the randomly generated `Id` value of the Tooltip element.<br/><br/>In case, the target element already holds an `aria-describedby` attribute with `Id` value of some other component, then the Tooltip Id value can be additionally appended to the existing `aria-describedby` attribute separated by a space as shown in the example below.<br/><br/>**For example**:<br/>aria-describedby = “my-text my-tooltip”<br/>**my-text** is the Id of some other component.<br/>**my-tooltip** is the id of Tooltip component.<br/><br/>When the Tooltip is closed, the `aria-describedby` attribute is removed from the target. |
48
-
| aria-hidden | This attribute is assigned to the Tooltip element whose default value is `true`.<br/><br/>When `true`, it denotes that the Tooltip element is in a hidden or a closed state. When the Tooltip appears on the screen, it’s value changes to `false`. |
46
+
|`role="tooltip"`| The element that serves as the container for the tooltip has the ARIA role of `tooltip`. |
47
+
|`aria-describedby`| This attribute is applied to the target element when the tooltip is shown by focus or hover. It typically contains the unique `ID`of the tooltip element.<br/><br/>If the target element already has an `aria-describedby` attribute referencing another component, the tooltip `ID` is appended, separated by a space.<br/><br/><strong>For example</strong>:<br/>`aria-describedby="my-text my-tooltip"`<br/><strong>my-text</strong> is the ID of another component.<br/><strong>my-tooltip</strong> is the ID of the tooltip component.<br/><br/>When the tooltip is hidden, the tooltip `ID`is removed from `aria-describedby`. |
48
+
|`aria-hidden`| This attribute is set on the tooltip element. The default value is `true` (hidden). When the tooltip is visible, its value changes to `false`. |
49
49
50
50
## Keyboard interaction
51
51
52
-
The Blazor Tooltip component followed the [keyboard interaction](https://www.w3.org/WAI/ARIA/apg/patterns/tooltip/#keyboardinteraction) guideline, making it easy for people who use assistive technologies (AT) and those who completely rely on keyboard navigation. The following keyboard shortcuts are supported by the Tooltip component.
52
+
The Blazor Tooltip component follows the [keyboard interaction](https://www.w3.org/WAI/ARIA/apg/patterns/tooltip/#keyboardinteraction) guideline, making it accessible for people who use assistive technologies and those who rely on keyboard navigation. The following keyboard shortcuts are supported by the Tooltip component.
53
53
54
54
| Windows | Mac | Actions |
55
55
| --- | --- | --- |
56
-
| <kbd>Escape</kbd> | <kbd>Escape</kbd> | Closes or dismisses the Tooltip. |
57
-
| <kbd>Tab</kbd> | <kbd>Tab</kbd> |A form control receiving focus (say through tab key), opens the Tooltip, and on focus out closes it. |
56
+
| <kbd>Escape</kbd> | <kbd>Escape</kbd> | Closes or dismisses the tooltip. |
57
+
| <kbd>Tab</kbd> | <kbd>Tab</kbd> |When a form control receives focus via the Tab key, the tooltip opens; when focus moves away, it closes. |
58
58
59
59
## Ensuring accessibility
60
60
61
-
The Blazor Tooltip component's accessibility levels are ensured through an [axe-core](https://www.nuget.org/packages/Deque.AxeCore.Playwright) software tool during automated testing.
62
-
63
-
The accessibility compliance of the Tooltip component is shown in the following sample. Open the [sample](https://blazor.syncfusion.com/accessibility/tooltip) in a new window to evaluate the accessibility of the Tooltip component with accessibility tools.
61
+
The Blazor Tooltip component's accessibility levels are validated with the [axe-core](https://www.nuget.org/packages/Deque.AxeCore.Playwright) tool during automated testing.
64
62
63
+
The accessibility compliance of the Tooltip component is demonstrated in the following sample. Open the [Tooltip accessibility sample](https://blazor.syncfusion.com/accessibility/tooltip) in a new window to evaluate the component with accessibility tools.
65
64
## See also
66
65
67
66
*[Accessibility in Syncfusion<supstyle="font-size:70%">®</sup> Blazor components](https://blazor.syncfusion.com/documentation/common/accessibility)
Copy file name to clipboardExpand all lines: blazor/tooltip/content.md
+14-15Lines changed: 14 additions & 15 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -9,11 +9,11 @@ documentation: ug
9
9
10
10
# Content in Blazor Tooltip Component
11
11
12
-
The Blazor Tooltip component allows you to display additional information when users hover over or interact with elements on your web page. Here's how you can explore and implement various content within your Tooltip to enhance its functionality and appearance.
12
+
The Blazor Tooltip component displays supplemental information when users hover over or interact with elements on a web page. This article explains multiple options for defining tooltip content and when to use each approach to enhance clarity and appearance.
13
13
14
14
## Simple Text Content
15
15
16
-
The simplest way to use a Tooltip is with a string of text using the [Content](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Popups.SfTooltip.html#Syncfusion_Blazor_Popups_SfTooltip_Content) property. A text or a piece of information assigned to the Tooltip’s `Content` property will be displayed as the main text stream of the Tooltip.
16
+
The simplest way to configure tooltip content is to provide a text string using the [Content](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Popups.SfTooltip.html#Syncfusion_Blazor_Popups_SfTooltip_Content) property. The value assigned to the `Content` property is rendered as the primary text of the tooltip.
17
17
18
18
```cshtml
19
19
@using Syncfusion.Blazor.Popups
@@ -29,13 +29,13 @@ The simplest way to use a Tooltip is with a string of text using the [Content](h
29
29
}
30
30
```
31
31
32
-
This displays a simple text message when users hover over the button.
32
+
This configuration displays a plain text message when the button receives hover or focus. The example text is illustrative and can be replaced with task-specific content.
33
33
34
-

34
+

35
35
36
36
## Using the Title Attribute
37
37
38
-
You can also use the **title** attribute of the target element as the Tooltip content. By using the [Target](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Popups.SfTooltip.html#Syncfusion_Blazor_Popups_SfTooltip_Target) property which allows the Tooltip to use the title attribute of the target element as its content.
38
+
The tooltip can also derive its content from the title attribute of the target element. The [Target](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Popups.SfTooltip.html#Syncfusion_Blazor_Popups_SfTooltip_Target) property defines the elements to which the tooltip is applied, and when those elements include a title attribute, that value is used as the tooltip content.
39
39
40
40
```cshtml
41
41
@using Syncfusion.Blazor.Buttons
@@ -53,16 +53,16 @@ You can also use the **title** attribute of the target element as the Tooltip co
53
53
54
54
```
55
55
56
-
This approach is useful when you want to enhance existing HTML title attributes with a more stylish Tooltip.
56
+
This approach is effective for enhancing existing title attributes with a styled tooltip, especially when retrofitting existing markup. The example includes a placeholder hyperlink (href="#") for demonstration.
57
57
58
-

58
+

59
59
60
60
61
61
## Using Template
62
62
63
-
The Tooltip's Template property enables you to completely customize the layout and incorporate custom elements into the Tooltip. You can insert any content or HTML elements as Tooltip content by specifying them within the [`ContentTemplate`](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Popups.SfTooltip.html#Syncfusion_Blazor_Popups_SfTooltip_ContentTemplate) property of the Tooltip component. Additionally, the [`ContentTemplate`](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Popups.SfTooltip.html#Syncfusion_Blazor_Popups_SfTooltip_ContentTemplate) property supports the `RenderFragment` type, enabling dynamic and interactive content within the Tooltip.
63
+
The Tooltip's Template capability enables full customization and the inclusion of custom elements. Provide any content or HTML elements through the [`ContentTemplate`](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Popups.SfTooltip.html#Syncfusion_Blazor_Popups_SfTooltip_ContentTemplate) property to compose rich content. The [`ContentTemplate`](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Popups.SfTooltip.html#Syncfusion_Blazor_Popups_SfTooltip_ContentTemplate) property supports the `RenderFragment` type, enabling dynamic and interactive content.
64
64
65
-
Check out the following code example to see how to include an HTML template inside the Tooltip.
65
+
The following example shows how to include an HTML template inside the tooltip.
66
66
67
67
```cshtml
68
68
@using Syncfusion.Blazor.Buttons;
@@ -176,14 +176,13 @@ The SfTooltip is used to display dynamic content generated using a RenderFragmen
176
176
}
177
177
```
178
178
179
-
This approach gives you full control over the Tooltip's content, allowing for interactive elementsand dynamic data.
179
+
This approach provides full control over the tooltip content and supports interactivity and dynamic data. When adding interactive elements, consider accessibility and focus behavior to ensure a predictable user experience.
180
180
181
-

181
+

182
182
183
183
## Rendering HTML content using MarkupString
184
184
185
-
By default, the Tooltip can show any kind of formatted content. To improve its layout or create a custom visual element, utilize the [`ContentTemplate`](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Popups.SfTooltip.html#Syncfusion_Blazor_Popups_SfTooltip_ContentTemplate) property to establish the desired structure. You can also use [`@(MarkupString)`](https://learn.microsoft.com/en-us/dotnet/api/microsoft.aspnetcore.components.markupstring?view=aspnetcore-7.0) to dynamically render HTML content.
186
-
185
+
By default, the tooltip can show formatted content. To improve the layout or create a custom visual element, use the [`ContentTemplate`](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Popups.SfTooltip.html#Syncfusion_Blazor_Popups_SfTooltip_ContentTemplate) property to define the structure. The [`@(MarkupString)`](https://learn.microsoft.com/en-us/dotnet/api/microsoft.aspnetcore.components.markupstring?view=aspnetcore-7.0) type can also be used to render HTML content from a string dynamically.
187
186
188
187
```cshtml
189
188
@using Syncfusion.Blazor.Popups
@@ -213,8 +212,8 @@ By default, the Tooltip can show any kind of formatted content. To improve its l
213
212
}
214
213
```
215
214
216
-
This is useful when you need to render HTML content that's stored as a string, perhaps from a database or API.
215
+
This option is useful when rendering HTML stored as a stringfrom a database or API. Do not render untrusted HTML without sanitization, as doing so may introduce cross-site scripting (XSS) vulnerabilities.
217
216
218
217

219
218
220
-
By using these different content options, you can create Tooltips that range from simple text hints to rich, interactive information displays, enhancing the user experience of your Blazor application.
219
+
By selecting the appropriate approach—plain text via `Content`, title attribute content via `Target`, rich layouts via `ContentTemplate`, dynamic UI via `RenderFragment`, or string-based HTML via `MarkupString`—the tooltip can convey anything from simple hints to rich, interactive information to improve the user experience.
Copy file name to clipboardExpand all lines: blazor/tooltip/customization.md
+4-4Lines changed: 4 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -9,11 +9,11 @@ documentation: ug
9
9
10
10
# Customization in Blazor Tooltip Component
11
11
12
-
The Tooltip can be customized by using the [`CssClass`](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Popups.SfTooltip.html#Syncfusion_Blazor_Popups_SfTooltip_CssClass) property, which accepts custom CSS class names that defines the specific user-defined styles and themes to be applied on the Tooltip element.
12
+
The Tooltip can be customized by using the [`CssClass`](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Popups.SfTooltip.html#Syncfusion_Blazor_Popups_SfTooltip_CssClass) property, which applies one or more custom CSS class names. These classes allow defining user-specific styles and themes that are applied to the tooltip wrapper and its elements.
13
13
14
14
## Tip pointer customization
15
15
16
-
Styling the tip pointer's size, background, and border colors can be done using the [`CssClass`](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Popups.SfTooltip.html#Syncfusion_Blazor_Popups_SfTooltip_CssClass) property, as given below.
16
+
Style the tip pointer size, background, and border colors using the [`CssClass`](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Popups.SfTooltip.html#Syncfusion_Blazor_Popups_SfTooltip_CssClass) property as shown below. The selectors target the generated tooltip wrapper and pointer elements that are set at runtime based on placement.
17
17
18
18
```cshtml
19
19
@using Syncfusion.Blazor.Popups
@@ -80,11 +80,11 @@ Styling the tip pointer's size, background, and border colors can be done using
80
80
</style>
81
81
```
82
82
83
-

83
+

84
84
85
85
## Tooltip customization
86
86
87
-
The complete look and feel of the Tooltip can be customized by changing it's background color, opacity, content font, etc.
87
+
The complete look and feel of the Tooltip can be customized by changing its background color, opacity, content font, and related styles. The following example demonstrates overriding theme styles by scoping CSS to a custom class applied through `CssClass`.
0 commit comments