diff --git a/components/splitter/accessibility/overview.md b/components/splitter/accessibility/overview.md new file mode 100644 index 000000000..5421bf0e6 --- /dev/null +++ b/components/splitter/accessibility/overview.md @@ -0,0 +1,189 @@ +--- +title: Accessibility Overview +page_title: Telerik UI for Blazor Splitter Documentation | Splitter Accessibility Overview +description: "Get started with the Telerik UI for Blazor Splitter and learn about its accessibility support for WAI-ARIA, Section 508, and WCAG 2.2." +tags: telerik,blazor,accessibility,wai-aria,wcag,splitter +slug: splitter-accessibility-overview +position: 0 +--- + +# Accessibility Overview + +The UI for Blazor Splitter component is [WCAG 2.2 AA](https://www.w3.org/TR/WCAG22) and [Section 508](https://www.section508.gov) compliant. The component also follows the [WAI-ARIA best practices](https://www.w3.org/WAI/ARIA/apg/) for implementing the keyboard navigation for its component [role](https://www.w3.org/TR/wai-aria/#roles), and is tested against the popular screen readers. + +# Blazor Splitter Accessibility Example + +WCAG 2.2 introduces the ["Dragging Movements"](https://www.w3.org/WAI/WCAG22/Understanding/dragging-movements) criterion as an important part of the Operable principle. Its primary goal is to guarantee that any feature reliant on drag actions offers an alternative method that can be executed with a single click, enhancing user accessibility. + +In our illustrative example below, we've showcased the pane resize action, achievable through our [Context Menu]({%slug contextmenu-overview%}). Our goal is to offer a versatile API that allows users to trigger all functions programmatically or externally, meeting diverse accessibility requirements for any applications. + +The following example demonstrates the [accessibility compliance of the Splitter component]({%slug splitter-wai-aria-support%}). The described level of compliance is achievable with the [Ocean Blue A11y Accessibility Swatch]({%slug themes-accessibility-swatch%}). + +>caption Splitter accessibility compliance example + +````CSHTML +@*Evaluate the example with Axe Core or other accessibility tools*@ + +@using Telerik.SvgIcons + + + + @{ + +
@item.Text
+ + @if (item.CommandName == "ResizePane") + { +
+ +
+ } + } +
+
+ + + + + +
+ Resizable and collapsible +
+
+ + +
+ Non-resizable pane. +
+
+ + +
+ Resizable and collapsible +
+
+ +
+
+ + + + + + + + + + Resize + Cancel + + + + + +@code { + private bool Visible { get; set; } + private int NewWidth { get; set; } + private string Unit { get; set; } = "px"; + private string ComboBoxValue { get; set; } = "px"; + + // Data sources + private List MenuItems { get; set; } + private List ComboBoxData = new List() { "px", "%" }; + + // Component references so we can use their methods + private TelerikContextMenu ContextMenuRef { get; set; } + + // Track the index of the pane from which the context menu is triggered + private int currentPaneIndex; + + // Store pane sizes + private List Panes { get; set; } = new List { new Pane { Size = 100, PaneCollapsed = false }, new Pane { Size = 100, PaneCollapsed = false} }; + + // Generate data + protected override void OnInitialized() + { + // Context menu items + MenuItems = new List() + { + new MenuItem(){ Text = "Resize pane", Icon = SvgIcon.ArrowsLeftRight, CommandName = "ResizePane" }, + new MenuItem(){ Text = "Collapse pane", Icon = SvgIcon.MinWidth, CommandName = "CollapsePane" } + }; + } + + #region ContextMenu and Dialog Action Handlers + // Show the context menu for a particular pane + private async Task ShowContextMenu(MouseEventArgs e, int paneIndex) + { + currentPaneIndex = paneIndex; + await ContextMenuRef.ShowAsync(e.ClientX, e.ClientY); + } + + // Sample handling of the context menu click + private void ContextMenuClickHandler(MenuItem item) + { + if (item.Action != null) + { + item.Action.Invoke(); + } + else + { + switch (item.CommandName) + { + case "ResizePane": + Visible = true; + break; + case "CollapsePane": + Panes[currentPaneIndex].PaneCollapsed = true; + break; + default: + break; + } + } + } + + private void OnApplyClick() + { + Panes[currentPaneIndex].Size = NewWidth; + Unit = ComboBoxValue; + Visible = false; + } + #endregion + + #region Models + // Sample menu item class + public class MenuItem + { + public string Text { get; set; } + public ISvgIcon Icon { get; set; } + public Action Action { get; set; } + public string CommandName { get; set; } + } + + public class Pane + { + public int Size { get; set; } + public bool PaneCollapsed { get; set; } + } + #endregion +} +```` + +## See also + * [Live demo: Splitter Accessibility](https://demos.telerik.com/blazor-ui/splitter/keyboard-navigation) \ No newline at end of file