Form controls
Select, Checkbox, Radio group, Switch, Slider, Textarea — every input on Base UI primitives.
Source:
src/components/ui/
Install:
npx shadcn@latest add select checkbox radio-group switch slider textarea --yes Rendered example — light + dark
Light
60
Dark
60
Recipes & props
A realistic usage snippet for this component. Imports come from
@/components/ui/….
See the
source
for the full API.
import { Select } from '@/components/ui/select';
import { Checkbox } from '@/components/ui/checkbox';
import { Switch } from '@/components/ui/switch';
export function Preferences() {
return (
<div className="space-y-4">
<Select items={[{ value: 'sm', label: 'Small' }, { value: 'lg', label: 'Large' }]} />
<label className="flex items-center gap-2">
<Checkbox defaultChecked /> Email me updates
</label>
<Switch aria-label="Dark mode" />
</div>
);
}