Native Select
The native HTML select restyled for forms, filters, and country pickers — OS-rendered dropdown with neobrutalist borders and shadows.
For a styled select component, see the Select component.
import {
NativeSelect,
NativeSelectOption,The native select is a thin styling layer over the browser's own <select> element — no primitive, no portal, no JavaScript. The closed control gets the neobrutalist recipe — thick borders, hard shadows, and bold type — while the open list stays the OS picker.
Reach for it when:
- Country, timezone, and currency pickers — long option lists the OS renders faster than any custom popover.
- Mobile-heavy forms — iOS and Android swap in their native picker wheel, which beats a custom dropdown on a small screen.
- Plain form posts — it's a real
<select name="…">, so the value submits with the form and works before hydration.
Installation#
pnpm dlx shadcn@latest add https://neobrutalism.com/r/base/native-select.jsonnpx shadcn@latest add https://neobrutalism.com/r/base/native-select.jsonyarn dlx shadcn@latest add https://neobrutalism.com/r/base/native-select.jsonbunx --bun shadcn@latest add https://neobrutalism.com/r/base/native-select.json
Copy and paste the following code into your project.
import * as React from "react"
import { ChevronDownIcon } from "lucide-react"
import { cn } from "@/lib/utils"
type NativeSelectProps = Omit<React.ComponentProps<"select">, "size"> & {
size?: "sm" | "default"
}
function NativeSelect({
className,
size = "default",
...props
}: NativeSelectProps) {
return (
<div
className={cn(
"group/native-select relative w-fit has-[select:disabled]:opacity-50",
className
)}
data-slot="native-select-wrapper"
data-size={size}
>
<select
data-slot="native-select"
data-size={size}
className="h-8 w-full min-w-0 appearance-none rounded border-2 bg-input py-2 pr-8 pl-3 text-sm shadow-sm transition-colors outline-none select-none selection:bg-primary selection:text-primary-foreground placeholder:text-muted-foreground focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-primary disabled:pointer-events-none disabled:cursor-not-allowed aria-invalid:border-destructive data-[size=sm]:h-7 data-[size=sm]:rounded data-[size=sm]:py-0.5"
{...props}
/>
<ChevronDownIcon
className="pointer-events-none absolute top-1/2 right-2.5 size-4 -translate-y-1/2 text-muted-foreground select-none"
aria-hidden="true"
data-slot="native-select-icon"
/>
</div>
)
}
function NativeSelectOption({
className,
...props
}: React.ComponentProps<"option">) {
return (
<option
data-slot="native-select-option"
className={cn("bg-[Canvas] text-[CanvasText]", className)}
{...props}
/>
)
}
function NativeSelectOptGroup({
className,
...props
}: React.ComponentProps<"optgroup">) {
return (
<optgroup
data-slot="native-select-optgroup"
className={cn("bg-[Canvas] text-[CanvasText]", className)}
{...props}
/>
)
}
export { NativeSelect, NativeSelectOptGroup, NativeSelectOption }
Update the import paths to match your project setup.
Usage#
import {
NativeSelect,
NativeSelectOptGroup,
NativeSelectOption,
} from "@/components/ui/native-select"<NativeSelect>
<NativeSelectOption value="">Select a fruit</NativeSelectOption>
<NativeSelectOption value="apple">Apple</NativeSelectOption>
<NativeSelectOption value="banana">Banana</NativeSelectOption>
<NativeSelectOption value="blueberry">Blueberry</NativeSelectOption>
<NativeSelectOption value="pineapple">Pineapple</NativeSelectOption>
</NativeSelect>Composition#
Simple#
Options placed directly under NativeSelect (no NativeSelectOptGroup).
NativeSelect
├── NativeSelectOption
├── NativeSelectOption
├── NativeSelectOption
└── NativeSelectOptionWith groups#
Use NativeSelectOptGroup to organize options into categories.
NativeSelect
├── NativeSelectOptGroup
│ ├── NativeSelectOption
│ └── NativeSelectOption
└── NativeSelectOptGroup
├── NativeSelectOption
└── NativeSelectOptionExamples#
Groups#
Use NativeSelectOptGroup to organize options into categories.
import {
NativeSelect,
NativeSelectOptGroup,Disabled#
Add the disabled prop to the NativeSelect component to disable the select.
import {
NativeSelect,
NativeSelectOption,Invalid#
Use aria-invalid to show validation errors and the data-invalid attribute to the Field component for styling.
import {
NativeSelect,
NativeSelectOption,Native Select vs Select#
- Use
NativeSelectfor native browser behavior, better performance, or mobile-optimized dropdowns. - Use
Selectfor custom styling, animations, or complex interactions.
RTL#
To enable RTL support in Neobrutalism.com, see the RTL configuration guide.
"use client"
import * as React from "react"Accessibility#
This is the platform's own <select>, which browsers already expose to assistive technology — it's the control the WAI-ARIA select-only combobox pattern exists to emulate. No ARIA wiring needed; just give it an accessible name via <Label htmlFor> or aria-label.
Keyboard behavior is supplied by the browser, so bindings vary slightly across OS and browser. The common set:
| Key | Action |
|---|---|
Space / Alt + ArrowDown | Open the option list |
ArrowDown / ArrowUp | Highlight the next / previous option |
Home / End | Jump to the first / last option |
Enter | Commit the highlighted option and close the list |
Escape | Close the list without changing the value |
| Printable characters | Typeahead — jump to the next option matching what you type |
API Reference#
NativeSelect#
The main select component that wraps the native HTML select element.
<NativeSelect>
<NativeSelectOption value="option1">Option 1</NativeSelectOption>
<NativeSelectOption value="option2">Option 2</NativeSelectOption>
</NativeSelect>NativeSelectOption#
Represents an individual option within the select.
| Prop | Type | Default |
|---|---|---|
value | string | |
disabled | boolean | false |
NativeSelectOptGroup#
Groups related options together for better organization.
| Prop | Type | Default |
|---|---|---|
label | string | |
disabled | boolean | false |
<NativeSelectOptGroup label="Fruits">
<NativeSelectOption value="apple">Apple</NativeSelectOption>
<NativeSelectOption value="banana">Banana</NativeSelectOption>
</NativeSelectOptGroup>