Native Select

Native Basic

A native select with a label and a custom arrow: the shell is ours, the drop-down list is drawn by the operating system.

  • select
  • native
  • form
  • mobile

Preview

1440pxHost theme

Use it with AI

  1. 1. Copy the link.
  2. 2. Write to your agent in your own words and drop the link into the sentence.
  3. 3. The agent opens the link and installs the component from the registry.

put this in the header: https://vibeui.ru/c/nativeselect-001?lang=en

Reminders and reports are counted in it.

Show the full instructions

What the link says, spelled out. Use it when your agent cannot open links — paste this text instead.

# Install and place "nativeselect-001" (Native Basic) from VibeUI

## 1. Install first — do not skip, do not recreate
Run this exact command before writing any code:
npx shadcn@latest add https://vibeui.ru/r/nativeselect-001.json

Registry item: https://vibeui.ru/r/nativeselect-001.json
Installs to: components/vibeui/nativeselect-001.tsx (the exact path follows this project's components.json aliases).
npm dependencies: none.
Registry dependencies: none.

Install it from the registry. Do not recreate it from the description,
do not substitute a similar component from another library, and do not
rewrite it to match the project's existing style.

## 2. What it is
A native select with a label and a custom arrow: the shell is ours, the drop-down list is drawn by the operating system.

A native select in a custom shell: label, hint, own arrow, system drop-down. Zero dependencies, one file, no client JS.

## 3. How to use it
import { Nativeselect001 } from "@/components/vibeui/nativeselect-001"

<Nativeselect001
  label="Time zone"
  hint="Reminders and reports are counted in it."
  options={["Lisbon, UTC+0", "Berlin, UTC+1"]}
/>

Read the installed file for the full prop list.

## 4. Where to place it
This is a small inline component. Put it exactly where the user asked,
inside the existing markup. Do not create a new page, section or
wrapper for it. If a similar control already sits in that spot,
replace it instead of adding a second one.

Placement: ___
(The user fills this line in. If it is still blank, ask where to put it
instead of guessing.)

## 5. Keep exactly as installed
- the local --vibeui-nativeselect-001-* palette — do not swap it for your theme tokens
- the native <select>: on a phone the system opens the familiar wheel, which never drifts on zoom and needs no JS
- pointer-events:none on the arrow — otherwise clicking it fails to open the list
- the right padding reserved for the arrow: without it a long option slides underneath
- the aria-describedby link for the hint — otherwise the line is visible but never spoken
- the block's own light surface: without it the dark label disappears on a dark background

## 6. You may change
- the field name through label, the explanation through hint and the choices through options
- the focus color through accent
- the field height and rounding through the palette variables
- the arrow shape: it is drawn with two borders and changes in one rule

## 7. Rules
- The inside of the open list cannot be styled: the browser draws it — that is the price of predictability on phones.
- Reach for a combobox instead only when you need search inside the list, custom icons per option, or more than a few dozen choices.
- options here are both value and caption: if the key differs from the text, pass objects and split out value.
- Do not lift the CSS variables into globals.css: the component has to stay a single file.

## 8. Verify
- it renders with no console errors;
- it looks like the preview on the VibeUI page you copied this from;
- if it does not, you changed something listed in section 5 — put it back.

For developers

npx shadcn@latest add https://vibeui.ru/r/nativeselect-001.json
https://vibeui.ru/r/nativeselect-001.json

Компонент самодостаточен: один файл, без зависимостей, палитра в локальных переменных --vibeui-nativeselect-001-*. Серверный: из хуков только useId. appearance:none снимает штатную стрелку платформы, вместо неё рисуется своя из двух граней квадрата; стрелка помечена pointer-events:none, поэтому вся площадь поля остаётся целью самого select. Правый отступ поля рассчитан под стрелку: без него длинный пункт заезжает под неё. Подсветка стрелки при фокусе сделана через :has(select:focus-visible) на обёртке. Список остаётся системным — на телефоне это привычное колесо, которое не ломается при масштабировании страницы и не требует ни строчки JS.

Component source

The same file your agent installs. Here in case you would rather copy it by hand.

import { useId } from "react"
import type { ComponentPropsWithoutRef, CSSProperties } from "react"

export type Nativeselect001Props = Omit<
  ComponentPropsWithoutRef<"select">,
  "children" | "size"
> & {
  label?: string
  hint?: string
  options?: string[]
  accent?: string
}

// Идея компонента: список остаётся системным, а нашего — только оболочка.
// appearance:none снимает штатную стрелку платформы, вместо неё рисуется
// своя из двух граней; сам выпадающий список рисует операционная система,
// поэтому на телефоне он открывается привычным колесом и не ломается
// при масштабировании страницы.
const STYLES = `
:where([data-vibeui-block="nativeselect-001"]){
--vibeui-nativeselect-001-surface:oklch(1 0 0);
--vibeui-nativeselect-001-surface-border:oklch(0.91 0.006 265);
--vibeui-nativeselect-001-fg:oklch(0.24 0.016 265);
--vibeui-nativeselect-001-muted:oklch(0.54 0.014 265);
--vibeui-nativeselect-001-field-border:oklch(0.85 0.01 265);
--vibeui-nativeselect-001-accent:oklch(0.55 0.2 262);
--vibeui-nativeselect-001-radius:0.625rem;
--vibeui-nativeselect-001-font:ui-sans-serif,system-ui,-apple-system,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;
}
[data-vibeui-block="nativeselect-001"]{
box-sizing:border-box;width:100%;max-width:22rem;
padding:1rem;border-radius:0.875rem;
background:var(--vibeui-nativeselect-001-surface);
border:1px solid var(--vibeui-nativeselect-001-surface-border);
font-family:var(--vibeui-nativeselect-001-font);color:var(--vibeui-nativeselect-001-fg);
display:flex;flex-direction:column;gap:0.375rem;
}
[data-vibeui-block="nativeselect-001"] label{
font-size:0.875rem;font-weight:600;line-height:1.3;cursor:pointer;
}
[data-vibeui-block="nativeselect-001"] [data-part="field"]{
position:relative;display:flex;
}
[data-vibeui-block="nativeselect-001"] select{
appearance:none;-webkit-appearance:none;
box-sizing:border-box;width:100%;height:2.5rem;
padding:0 2.25rem 0 0.75rem;
font:inherit;font-size:0.9375rem;line-height:1.2;
color:var(--vibeui-nativeselect-001-fg);
background:var(--vibeui-nativeselect-001-surface);
border:1px solid var(--vibeui-nativeselect-001-field-border);
border-radius:var(--vibeui-nativeselect-001-radius);
cursor:pointer;
transition:border-color .16s ease,box-shadow .16s ease;
}
[data-vibeui-block="nativeselect-001"] select:focus-visible{
outline:none;border-color:var(--vibeui-nativeselect-001-accent);
box-shadow:0 0 0 3px color-mix(in oklab,var(--vibeui-nativeselect-001-accent) 22%,transparent);
}
/* Стрелка — две грани квадрата, повёрнутые на 45°. Клики она не ловит:
   pointer-events:none оставляет всю площадь поля самому select. */
[data-vibeui-block="nativeselect-001"] [data-part="arrow"]{
position:absolute;right:0.875rem;top:50%;pointer-events:none;
width:0.4375rem;height:0.4375rem;
border-right:1.5px solid var(--vibeui-nativeselect-001-muted);
border-bottom:1.5px solid var(--vibeui-nativeselect-001-muted);
translate:0 -0.1875rem;rotate:45deg;
transition:border-color .16s ease;
}
[data-vibeui-block="nativeselect-001"] [data-part="field"]:has(select:focus-visible) [data-part="arrow"]{
border-color:var(--vibeui-nativeselect-001-accent);
}
[data-vibeui-block="nativeselect-001"] [data-part="hint"]{
margin:0;font-size:0.8125rem;line-height:1.45;
color:var(--vibeui-nativeselect-001-muted);
}
@media (prefers-reduced-motion:reduce){[data-vibeui-block="nativeselect-001"] *{animation:none!important;transition:none!important}}
`

/**
 * Нативный select с подписью и собственной стрелкой: оболочка наша,
 * выпадающий список системный. Один файл, ноль зависимостей.
 */
export function Nativeselect001({
  label = "Часовой пояс",
  hint = "По нему считаются напоминания и отчёты.",
  options = [
    "Москва, UTC+3",
    "Екатеринбург, UTC+5",
    "Новосибирск, UTC+7",
    "Владивосток, UTC+10",
  ],
  accent,
  className,
  style,
  ...props
}: Nativeselect001Props) {
  const id = useId()
  const hintId = `${id}-hint`
  const palette = {
    ...(accent ? { "--vibeui-nativeselect-001-accent": accent } : null),
    ...style,
  } as CSSProperties

  return (
    <>
      <style href="vibeui-nativeselect-001" precedence="medium">
        {STYLES}
      </style>
      <div
        data-vibeui-block="nativeselect-001"
        className={className}
        style={palette}
      >
        <label htmlFor={id}>{label}</label>
        <div data-part="field">
          <select {...props} id={id} name="timezone" aria-describedby={hintId}>
            {options.map((option) => (
              <option key={option} value={option}>
                {option}
              </option>
            ))}
          </select>
          <span data-part="arrow" aria-hidden="true" />
        </div>
        <p data-part="hint" id={hintId}>
          {hint}
        </p>
      </div>
    </>
  )
}