Glow select
Dropdown select with a floating label that springs on selection and a cursor-mapped pastel border glow. Dropdown springs in with opacity and translateY. Chevron rotates with spring physics.
- Spring Physics
- requestAnimationFrame
- pastelColour
glow-select
Country
Plan
Status
Click to open. Move your cursor around.
Usage
Drop it in
import { GlowSelect } from "@/app/lib/components/glow-select";<GlowSelect
label="Country"
options={[{ value: "uk", label: "United Kingdom" }]}
value={country}
onChange={setCountry}
/>API
Props
| Prop | Type | Default |
|---|---|---|
options*Available options | GlowSelectOption[] | — |
value*Controlled value | string | — |
onChange*Change handler | (value: string) => void | — |
labelFloating label text | string | "Label" |
placeholderPlaceholder when no value is selected | string | "Select…" |
disabledDisables the select and suppresses all glow and spring motion | boolean | false |
classNameAdditional class names applied to the outermost wrapper div | string | "" |
Read from the component's source at build time. * required.
Accessibility
Works with
- Cursor
- Reacts to where the pointer is, not just whether it's over the element.
- Touch
- Follows your finger while it's down, then settles a moment after you lift.
- Keyboard
- Focus lights it up the way the cursor does. Every action has a key.
- Reduced motion
- Nothing moves or springs. Colour still answers, without drifting.