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: packages/tabs/README.md
+52-11Lines changed: 52 additions & 11 deletions
Original file line number
Diff line number
Diff line change
@@ -8,29 +8,68 @@ The `<sp-tabs>` displays a list of `<sp-tab>` element children as `role="tablist
8
8
[](https://bundlephobia.com/result?p=@spectrum-web-components/tabs)
9
9
[](https://stackblitz.com/edit/vitejs-vite-3smxuwr2)
10
10
11
-
```
11
+
```zsh
12
12
yarn add @spectrum-web-components/tabs
13
13
```
14
14
15
15
Import the side effectful registration of `<sp-tabs>`, `<sp-tab>` or `<sp-tab-panel>` via:
An `<sp-tabs>` element will display horizontally by default. It can be modified with states like `compact`, `disabled`, and `quiet`, or with content like icons, etc.
109
148
@@ -207,7 +246,7 @@ When an `<sp-tabs>` element is given the `disabled` attribute its `<sp-tab>` chi
207
246
</sp-tab-panel>
208
247
</sp-tabs>
209
248
210
-
## Vertical Tabs
249
+
###Vertical Tabs
211
250
212
251
An `<sp-tabs>` element will display horizontally by default. It can be modified with states like `compact`, `disabled`, and `quiet`, or with content like icons, etc.
213
252
@@ -314,3 +353,5 @@ When an `<sp-tabs>` element is given the `disabled` attribute its `<sp-tab>` chi
314
353
## Accessibility
315
354
316
355
When an `<sp-tabs>` has a `selected` value, the `<sp-tab>` child of that `value` will be given `[tabindex="0"]` and will receive initial focus when tabbing into the `<sp-tabs>` element. When no `selected` value is present, the first `<sp-tab>` child will be treated in this way. When focus is currently within the `<sp-tabs>` element, the left and right arrows will move that focus back and forth through the available `<sp-tab>` children.
356
+
357
+
Tab items should have a label for accessibility. If a label isn’t present, it must include an icon and becomes an icon-only tab item. Icons should only be used in a tab item when absolutely necessary: when adding essential value and having a strong association with the label. If the tab item does not have a visible label, it must still have a tooltip to disclose the label.
0 commit comments