Skip to content

Commit e767378

Browse files
web-padawanclaude
andcommitted
docs: add Accessibility section to Split Layout
Document the keyboard and screen reader support for the split handle added in vaadin/web-components#11964: slider semantics, keyboard shortcuts, and the customizable separator label via the i18n property. The Flow SplitLayoutI18n API (vaadin/flow-components#9694) is included alongside the Lit and React examples. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent 2d40dec commit e767378

1 file changed

Lines changed: 65 additions & 0 deletions

File tree

articles/components/split-layout/index.adoc

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,71 @@ include::{root}/frontend/demo/component/splitlayout/react/split-layout-toggle.ts
167167
endif::[]
168168
--
169169

170+
== [since:com.vaadin:vaadin@V25.3]#Accessibility#
171+
172+
The split handle can be focused and operated with the keyboard, allowing users to resize the content areas without a pointing device. To assistive technologies, the handle is exposed as a slider (`role="slider"`). It announces the size of the primary content area as a percentage of the available space -- through `aria-valuenow` and `aria-valuetext` -- together with the layout's orientation, through `aria-orientation`.
173+
174+
Clicking the handle moves focus to it, while dragging it leaves focus unchanged so as not to interrupt pointer interaction.
175+
176+
When the handle has focus, it can be moved with the following keys:
177+
178+
[cols="1,2"]
179+
|===
180+
|Shortcut |Function
181+
182+
|kbd:[Right] / kbd:[Down]
183+
|Grows the primary content area by a small step.
184+
185+
|kbd:[Left] / kbd:[Up]
186+
|Shrinks the primary content area by a small step.
187+
188+
|kbd:[Page Down]
189+
|Grows the primary content area by a larger step.
190+
191+
|kbd:[Page Up]
192+
|Shrinks the primary content area by a larger step.
193+
194+
|kbd:[Home]
195+
|Collapses the primary content area.
196+
197+
|kbd:[End]
198+
|Collapses the secondary content area.
199+
200+
|===
201+
202+
The arrow key directions are reversed automatically for right-to-left languages.
203+
204+
The handle has a default accessible name, `Resize separator`, which can be customized:
205+
206+
[.example]
207+
--
208+
ifdef::flow[]
209+
[source,java]
210+
----
211+
SplitLayout layout = new SplitLayout();
212+
213+
SplitLayoutI18n i18n = new SplitLayoutI18n()
214+
.setSeparator("Resize separator");
215+
layout.setI18n(i18n);
216+
----
217+
endif::[]
218+
219+
ifdef::lit[]
220+
[source,html]
221+
----
222+
<vaadin-split-layout .i18n="${{ separator: 'Resize separator' }}"></vaadin-split-layout>
223+
----
224+
endif::[]
225+
226+
ifdef::react[]
227+
[source,tsx]
228+
----
229+
<SplitLayout i18n={{ separator: 'Resize separator' }} />
230+
----
231+
endif::[]
232+
--
233+
234+
170235
== Best Practices
171236

172237
* Don't use Split Layout when either content area has, or should have, a fixed size.

0 commit comments

Comments
 (0)