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: src/prose/features/00-motivations/accessibility.md
+6-11Lines changed: 6 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,25 +4,22 @@ publish: true
4
4
order: 0
5
5
---
6
6
7
-
Baleada Features implements comprehensive, reusable, flexible features for **accessibility**, one of the core motivations behind the package.
7
+
Baleada Features implements comprehensive**accessibility**.
8
8
9
-
Some accessibility features—like ARIA role & attribute management, keyboard interactions, and focus management—are always required.
10
-
Baleada Features takes care of all of those things for you!
9
+
This includes accessibility features that are always required (like ARIA role & attribute management, keyboard interactions, and focus management) as well as optional, situational, and dynamic features.
11
10
12
-
For example, use your mouse, keyboard, touch, and screen reader to play with this custom multiselectable listbox, and note:
11
+
For example, use your mouse, keyboard, touch, and screen reader to play with this custom multiselectable listbox, and note these features, required by WAI-ARIA guidelines:
13
12
- It announces itself properly to assistive tech, including selection state and disabled state
14
13
- It supports Excel-inspired pointer and keyboard interactions
15
14
- It automatically manages focus on the listbox options
Other accessibility features are optional or situational.
20
-
21
-
For example, after you add the required accessible label to a listbox, you might want to add an optional description, announced to assistive tech. Baleada Features makes it easy to do so.
18
+
And note how this listbox, which has the required label, also has a fully optional description that gets announced to assistive tech. Baleada Features makes this easy to do.
The web platform is amazing, but when it comes to accessibility, it's still missing so many UI components, and so much configurability.
69
-
70
-
Baleada Features aims to close that gap.
65
+
When it comes to accessibility, the web platform is amazing, but it's still missing so many UI components, and so much configurability. Baleada Features aims to close that gap.
Baleada Features is designed around**composability**—the ability to build complex features by combining simpler, reusable pieces.
7
+
Baleada Features is designed for**composability**—the ability to build complex UIs by combining smaller reusable pieces.
8
8
9
-
The package organizes features into layers that build on each other:
9
+
You can use an [interface](/docs/features/interfaces-overview) or a [combo](/docs/features/combo-overview) to wire up essential UI logic and [accessibility](/docs/features/motivations/accessibility) features, then add [extensions](/docs/features/extensions-overview) to bring additional functionality. You can even drop down to [affordances](/docs/features/affordances-overview) for lower level tasks like binding props or adding custom event listeners to an existing element.
10
10
11
-
1.**Affordances** — Low-level tools for binding attributes, handling events, and showing/hiding elements
12
-
2.**Extensions** — Reusable behaviors like `usePopup`, `useFocus`, `usePress`, and `useHover`
13
-
3.**Interfaces** — Complete accessible UI patterns like `useListbox`, `useButton`, and `useTextbox`
14
-
4.**Combos** — Full components that combine interfaces and extensions, like `useCombobox`, `useSelect`, and `useMenu`
15
-
16
-
Each layer composes features from the layers below it, and you can use any layer directly depending on your needs.
17
-
18
-
19
-
:::
20
-
## Extensions compose into interfaces
21
11
:::
22
-
23
-
Extensions add focused, reusable behaviors to elements. For example, `usePress` handles all the complexity of pointer and keyboard press interactions:
24
-
25
-
::: canCopy
26
12
```ts
27
-
import { usePress } from'@baleada/vue-features'
28
-
29
-
const press =usePress(element)
30
-
31
-
// React to press events
32
-
watch(press.firstDescriptor, () => {
33
-
console.log('Pressed!')
34
-
})
35
-
```
36
-
:::
37
-
38
-
Interfaces like `useButton` compose extensions internally. A button needs press detection, ability state, and proper ARIA bindings—`useButton` composes all of these together:
39
-
40
-
::: canCopy
41
-
```ts
42
-
import { useButton } from'@baleada/vue-features'
43
-
44
-
const button =useButton()
45
-
// Internally composes usePress, useAbility, bind(), and more
46
-
```
47
-
:::
48
-
49
-
50
-
:::
51
-
## Interfaces compose into combos
52
-
:::
53
-
54
-
When you need a complete component, like a combobox with a textbox, button, and popup listbox, you can use a combo. Combos compose multiple interfaces and extensions:
Composability means you're never locked into a single approach. Start with a high-level combo, drop down to interfaces when you need more control, and use extensions and affordances when you need to build something truly custom.
34
+
Baleada Features is a love letter to the Vue 3 Composition API, showcasing the composability it unlocks.
0 commit comments