Native Select

@sushindustries/ui

The platform's own select in the site's clothes - the phone wheel and the OS menu, kept.

4 min read
View as MarkdownEdit on GitHub

A native <select> restyled to match the site's fields, with a drawn-on chevron replacing the one appearance: none removes. Reach for it for any fixed set of options where the platform's own picker is welcome.

Viewport width
Phone22remthe floor, the narrowest this promises to work at
tanstacktanstack add https://adamjurek.com/r/tanstack/native-select.jsonshadcnpnpm dlx shadcn@latest add https://adamjurek.com/r/shadcn/native-select.json

Why it is built this way

Opening it hands off entirely to the platform: the OS menu on desktop, the wheel on iOS, the sheet Android draws for <select>. That handoff is the whole argument for it over a listbox rebuilt in divs, and it is also why only the closed state is this component's to style - the chevron replaces the one appearance: none takes away along with the browser's own styling.

What it does not do

It cannot show more than text in an option - no icon, no description, no price next to a label - because the OS renders the popup and only reads the option's text. Multiple selection and in-page search are out for the same reason: there is no listbox here to replace a native <select> with.

Install commands are not written here

Anything in packages/ui/registry.ts gets its TanStack and shadcn commands attached automatically, so there is nothing to keep in sync.

Install

tanstack add https://adamjurek.com/r/tanstack/native-select.json
shell
pnpm dlx shadcn@latest add https://adamjurek.com/r/shadcn/native-select.json
shell
pnpm add @sushindustries/ui @sushindustries/atoms
shell

What you get

Version0.1.0
Categorycontent · Forms
Filesnative-select.tsx
DependenciesNone
Also installsiconIconThe glyph set, generated from a Markdown table where every drawing carries its reason. One component, typed names, no icon font.@sushindustries/ui · content
Tagsform, no-deps

No runtime dependencies

It brings nothing with it beyond the stylesheet.

UsesIconIconThe glyph set, generated from a Markdown table where every drawing carries its reason. One component, typed names, no icon font.@sushindustries/ui · content