# Slab 0.2.0

> Ten new components, from Command Palette to Feed, translations, and an accessibility pass over the rest.

0.2.0 brings ten new components, `registerStrings()` to translate what the elements say, and the fixes from an accessibility audit of every component. It's a minor release because Range Slider's and Color Picker's thumbs moved their focus, so check how you style it.

## TL;DR

- Ten new components, each headless, with its keyboard, ARIA and form support done.
- Checkbox and radio Menu Items, and Option Groups for Listbox, Select and Combobox.
- `registerStrings()` translates the words Slab's elements say on their own.
- Screenreaders now hear the labels, hints, errors and results they used to miss.
- Range Slider's and Color Picker's focus rings move to a `focus-visible` part.

## New components

- [Command Palette](../components/command-palette.md): A Dialog with a search box and a list of commands. Typing filters them, and Enter runs the best match.
- [Hover Card](../components/hover-card.md): A preview of where a link goes, on hover and keyboard focus, with room for links of its own.
- [Navigation Menu](../components/navigation-menu.md): A site's navigation as the APG's disclosure navigation: buttons that show lists of links.
- [Tags Input](../components/tags-input.md): A text input that turns what's typed or pasted into tags, each submitted as its own value.
- [Editable](../components/editable.md): Text edited in place: a button that becomes an input. Enter commits and Escape discards.
- [Date Range Field](../components/date-range-field.md): Two native date inputs, each bounded by the other, that submit a start and an end.
- [Copy Button](../components/copy-button.md): Copies `value`, or another element's text with `from`, and says so to screenreaders.
- [Password Field](../components/password-field.md): A password input with a toggle button that shows and hides what was typed.
- [Steps](../components/steps.md): Where the user is in a checkout or a wizard, with Steps they can go back to when `navigable`.
- [Feed](../components/feed.md): Articles that load as the user scrolls, with Page Down and Page Up between them.

## Also new

- [Checkbox and radio Menu Items](../components/menu.md): Menu Item takes `type="checkbox"` or `type="radio"`, and the new Menu Group names a set of radios in a Menu or Context Menu.
- [Option Group](../components/listbox.md): Options under a heading in Listbox, Select and Combobox. The arrow keys and typeahead go across groups, and Combobox hides one that's filtered empty.
- [Translations](../get-started.md#words): `registerStrings()`, from `slab-elements/strings.js`, words what the elements say, such as "Dismiss" or "Next slide", for the nearest `lang`.

## Accessibility, everywhere

### Screenreaders

- `aria-*` on a component's host reaches the element a screenreader reads. In Checkbox, Color Picker, Combobox, Date Field, Disclosure, File Drop, Number, Pin Input, Range Slider, Slider, Switch, Text Field, Textarea, Time Field.
- The browser's own message, in its language, when a built-in constraint fails. In Text Field, Textarea, Number, Date Field, Time Field, File Drop, Checkbox, Checkbox Group, Radio Group, Listbox, Select, Combobox, Rating, Pin Input.
- Field's description and error describe its control, and mark it invalid. In Field.
- Groups and Switch say when they're invalid. In Checkbox Group, Radio Group, Switch.
- Combobox announces how many results are left, and which tag was removed. In Combobox.

### Keyboard

- Left and Right follow the reading direction, right to left too. In Tabs, Toolbar, Toggle Group, Radio Group, Menubar, Tree, Calendar, Color Picker, Combobox.
- Enter is left to an input method while it's composing. In Text Field, Number, Pin Input, Combobox.
- A click on the label focuses the control, as a native select's does. In Select, Listbox.
- Toasts with an action stay open, and F6 moves focus to them. In Toast.

### Motion, color and touch

- Autoplay stops under reduced motion, and for good once focus moves in. In Carousel.
- The colors to pick from stay in forced colors. In Color Picker.
- Thumbs are native range inputs, so phone screenreaders adjust them with a swipe. In Range Slider, Color Picker.

## Before you upgrade

### Range Slider's focus ring

Each thumb holds a hidden range input that takes focus, so the thumb itself isn't `[role=slider]` and doesn't match `:focus-visible`. Style its ring through the `focus-visible` part.

Before:

```css
slab-range-slider::part(start):focus-visible {
  outline: 3px solid;
}
```

After:

```css
slab-range-slider::part(start focus-visible) {
  outline: 3px solid;
}
```

### Color Picker's focus ring

The same for the area, hue and alpha thumbs. The area has a second hidden input, for brightness, out of the tab order.

Before:

```css
slab-color-picker::part(hue-thumb):focus-visible {
  outline: 3px solid;
}
```

After:

```css
slab-color-picker::part(hue-thumb focus-visible) {
  outline: 3px solid;
}
```

## Upgrade

```sh
pnpm add slab-elements@0.2.0
```
