# Liquid segmented control

The segmented control whose selection is one bead of glass. It is the kit’s control: the same tray, native radios and labels. Held, the bead is where the finger is; let go and it settles on the nearest segment without bounce. It stretches behind its head, and a long quick move leaves a drop that it takes back in. The bead is as wide as the segment it is over, so segments of unequal width work.

Kit part · With the Kit · https://tactileui.dev/parts/liquid-segmented

> The code and styling for this part come with the Tactile UI Kit, which the Pass and the Founder Pass include. Sign in if you have it. Sign in: https://tactileui.dev/auth/sign-in The price: https://tactileui.dev/pricing

## Anatomy

The bead is a pill of glass drawn by one shader: a dome whose rim bends a painted copy of the control’s own tray and labels, lit from above left, with a soft shadow. The keys’ own raised look is removed under the bead, and if the glass cannot be drawn a frosted CSS bead takes its place.

## Variants

- Three views
- Unequal segments
- Two segments
- One segment disabled
- Whole control disabled

## States

- First
- Middle
- Last
- Disabled

## Props and options

| Name | Kind | Description |
| - | - | - |
| change | event | The checked radio’s own change event; its value is the selection. |
| data-liquid | attribute | Which bead is showing. Read it, do not write it: the script falls back to frosted when WebGL2 is missing, the context is lost or reduced transparency is set. |
| liquidSegmentedHTML(options) | function | The control as markup. |
| liquidSegmentedStats() | function | What is drawing: WebGL contexts open (0 or 1 for the whole page), controls on the page, and how many of them are glass. |

## Usage notes

Drag the bead and let go, or tap a segment. Focus the group and press an arrow key. Without WebGL, or with reduced transparency set, the bead is frosted instead of glass and everything else is the same.

## Accessibility

- Keyboard: Tab reaches the checked segment, the arrow keys move the selection and the bead goes there. These are the native radio keys.
- The selection is never the glass: the checked radio is the truth, and the checked segment’s label takes the kit’s ink.
- Frosted fallback. It still follows the finger and springs.
- A disabled segment or a disabled control does not take the bead; a tap on it does nothing.

## Related parts

- [Segmented control](https://tactileui.dev/parts/segmented): A row of keys in a tray with one pressed down: pick a view, a range or a mode and it applies at once. It is the kit’s selector without the lamps, with sizes, a full-width row and icon segments.
- [Liquid switch](https://tactileui.dev/parts/liquid-switch): The settings switch whose thumb is a drop of glass. It is the kit’s switch. Held, the thumb is exactly where the finger is; let go and it carries on at the finger’s speed and settles without bounce. It stretches as it travels, and on a quick move it leaves a small drop behind that it takes back in. The glass bends a painted copy of the switch’s own track, so the slot’s colour shows through the thumb.
- [Toggle group](https://tactileui.dev/parts/toggle-group): The segmented control’s keys, each latching on its own, so any number can be down at once: bold and italic, the columns a table shows, the filters on a log. Every key is a checkbox and posts with the form. A lone toggle is a group of one, and a parting line splits clusters of keys in one slot.
- [Cloth selector](https://tactileui.dev/parts/cloth-selector): A mode switch made of cloth. A row of tiles covered in stretched fabric stands in a machined tray, each with an icon and a word pressed into it. The chosen tile sits a touch lower and a lamp behind it lights its icon and word through the weave. Choose another and the first lamp fades down as the next comes up. Underneath it is a group of native radios, so it posts one value without any script.
