Skip to content

Styled Native Select

Pure CSS restyle of the native select element with a custom arrow, focus ring, error, success and disabled states, and three sizes.

Also known as: custom select dropdown, styled dropdown menu, custom select arrow, select input styling

Styled Native Select live demo

Open in new tab

Pure CSS code (HTML, CSS)

A set of native <select> elements restyled with pure CSS: a custom chevron arrow, a soft focus ring, error, success and disabled states, a muted placeholder and three sizes. Because the real select element stays in place, you keep the native option list, mobile pickers, form submission and keyboard behavior. Use it in checkout forms, settings pages and filters.

How it works

The root form.ns-panel holds a heading and an .ns-grid of .ns-group blocks, each with an .ns-label, an .ns-field wrapper and an .ns-help message. The .ns-select inside the wrapper uses appearance: none to remove the browser arrow, then gets its own border, radius, height and padding. The arrow is drawn by .ns-field::after from two borders rotated by 45 degrees, so its color comes from a custom property instead of a hard-coded SVG. pointer-events: none lets clicks pass through it to the select, and while the select has focus the arrow flips upward via .ns-field:focus-within::after.

States use plain selectors. .ns-select:required:invalid mutes the text while the empty placeholder option is chosen. [aria-invalid="true"] and :user-invalid turn the border red, and .ns-field:has(...) tints the arrow to match. .ns-field--valid shows the success color, and :disabled gives a dashed border with a not-allowed cursor. No JavaScript is needed.

Customization

  • --ns-accent and --ns-ring on .ns-panel: the focus border color and the translucent ring around a focused select.
  • --ns-arrow: the default color of the chevron drawn by .ns-field::after.
  • --ns-error and --ns-success: border, arrow and help text colors for the error and valid states.
  • --ns-radius and --ns-height: corner radius and height of every select; set --ns-radius: 999px for pill-shaped fields.
  • .ns-field--sm and .ns-field--lg on the wrapper: switch a field to the small or large size, which overrides --ns-height, --ns-font-size and --ns-radius.
  • .ns-field--valid on the wrapper: shows the green success state, for example after server-side validation passes.
  • grid-template-columns in the .ns-grid media query: one column on phones, two from 640px.

Use cases

  • Checkout forms: styled selects for country and shipping keep native mobile pickers
  • Settings pages: error, success and disabled states show validation status on each select
  • Filters: three sizes fit both compact toolbars and large forms
  • Form-heavy apps: the real select element keeps native keyboard behavior and form submission

Accessibility

Every select has a visible <label for> or an aria-label, and help or error text is connected with aria-describedby. The error state is announced through aria-invalid="true", not color alone, and the message text explains the problem. The focus ring appears on :focus-visible with a 4px halo that stays visible on the cream background. All keyboard behavior is native: arrow keys, type-ahead and Alt+Down to open the list. Transitions on the arrow and border are removed under prefers-reduced-motion: reduce.

Usage notes

The native dropdown list itself is drawn by the operating system, so only the closed control is styled. :has() and :user-invalid need a current browser; older ones simply keep the default arrow color and skip the late error styling.

Styled Native Select at a glance

Framework
Pure CSS
Code
HTML, CSS
JavaScript
Not needed, CSS only
Dependencies
None
Layout
Responsive, works on mobile
Category
Selects
License
Free for personal and commercial use

Questions about this template

Can I use the Styled Native Select code for free?

Yes. You can copy or download the code and use it in personal and commercial projects, including client work. No sign-up is needed. Reselling it as part of a component library or template collection is not allowed; see the license.

How do I add it to my website?

There is nothing to install. Paste the HTML where the component should appear and add the CSS to your stylesheet. Download HTML gives you a complete page with everything already linked.

Does it need jQuery or a JavaScript framework?

No. It is built with HTML and CSS only, so there is no JavaScript to load.

Does it work on mobile?

Yes. The layout adapts to small screens. Use the Mobile and Tablet buttons above the live demo to check it at phone and tablet width.

Requirements

No dependencies. Pure HTML, CSS and JavaScript.

Styled Native Select – free Pure CSS select template
Styled Native Select · free Pure CSS select template

More Selects

Multi-Select Dropdown with Checkboxes – free Bootstrap 5 select template

Multi-Select Dropdown with Checkboxes

Bootstrap 5 multi-select dropdown with checkboxes, live search, select all and clear, a selected count badge and removable chips.

Styled Form Select Sizes – free Bootstrap 6 select template

Styled Form Select Sizes

Bootstrap 6 native selects styled with .form-control in small, default and large sizes, plus option groups, a disabled field and a multi-select with a live summary.

Multi-Select with Chips – free Bootstrap 6 select template

Multi-Select with Chips

Dark Bootstrap 6 multi-select Combobox where chosen teams appear as removable Chips, with check marks, member totals, keyboard removal and a hidden form value.

Country Select with Flags – free Bootstrap 6 select template

Country Select with Flags

Bootstrap 6 Combobox of countries with emoji flags and dial codes, searchable by name or code, feeding a phone number field and an SMS preview.

Searchable Select with Combobox – free Bootstrap 6 select template

Searchable Select with Combobox

Bootstrap 6 Combobox time zone picker with live search, grouped options, type-ahead, keyboard navigation and a local-time clock card.

Searchable Select – free Tailwind CSS select template

Searchable Select

Accessible Tailwind CSS combobox that filters options as you type, highlights matches and supports full keyboard navigation.