# WheelPicker A wheel-style single select that keeps native select behavior as the source of truth. ## Usage Use standalone. ```svelte ``` ## Anatomy The `class` attribute values represent part names. Other attributes represent their corresponding props. ```svelte
``` - The sr-only `select.main` remains the source of truth for focus, keyboard input, typeahead, change events, and form submission. - `middle` renders the decorative wheel and writes pointer or wheel movement back to the native select. Tapping a visible row selects that option, or the nearest enabled option if that row is disabled. - `loop` visually wraps movement, but the native select value stays a normal finite option list. - `aux` is the center selection band, and `extra` is intended for overlays such as top and bottom fades. ## Props | Name | Type | Default | Description | |---|---|---|---| | `options*` | `WheelOption[]` | - | Selectable values; disabled options remain visible but are skipped when snapping from pointer or wheel input | | `value` | `string` | - | Bindable selected option value; defaults to the first enabled option | | `loop` | `boolean` | `false` | Enables visual circular movement when there are at least two options | | `perspective` | `number` | - | 3D wheel perspective in px | | `maxAngle` | `number` | `60` | Maximum 3D wheel label angle in degrees | | `label` | `Snippet` | - | Custom content for each wheel row | | `cssvar` | `Record` | - | Mirrors measured values to CSS custom properties on `whole` | | `attach` | `Attachment` | - | Svelte attachment on the native select | | `element` | `HTMLSelectElement` | - | Bindable native select element | | `styling` | `SVSClass` | - | Styling override | | `variant` | `SVSVariant` | `NEUTRAL` | Variant for non-selected, enabled labels | `*` required. Other `HTMLSelectAttributes` are passed to `` is the source of truth: focus, arrow keys, typeahead, change, and `name` submission stay native; it remains focusable through clip-based hiding. - `.middle` is the decorative drum: it is `aria-hidden`, pointer/wheel gestures write `selectedIndex` to the select, item height is measured, and visible row count is derived. - Tapping a visible drum row selects that option; a tap on a disabled row snaps to the nearest enabled option. This relies on `.aux` / `.extra` staying `pointer-events: none`. - `loop` wraps `selectedIndex` modularly with seam clones; the ``): `aria-orientation="vertical"`. - Visual layers (`middle`, `aux`, and `extra`): `aria-hidden="true"` because the native select owns focus, value, and assistive-technology exposure. Provide an accessible name yourself because there is no built-in visible label. Pass `aria-label` or `aria-labelledby` through the rest props, or associate a `