A native select styled to match Input. It is accessible, mobile-friendly and has no JS overhead.
import { Select } from "@kivu-ui/react"On this page
import { Select } from "@kivu-ui/react";import { Select } from "@kivu-ui/react";
export default function Demo() {
return (
<div className="grid w-full max-w-xl gap-4 sm:grid-cols-2">
<Select label="Role" options={["Editor", "Viewer", "Admin"]} defaultValue="Editor" />
<Select
label="Status"
placeholder="Choose one"
defaultValue=""
options={[
{ value: "todo", label: "To do" },
{ value: "doing", label: "In progress" },
{ value: "done", label: "Done" },
{ value: "archived", label: "Archived", disabled: true },
]}
/>
</div>
);
}Extends all <select> attributes except size. You can also pass <option> children.
| Prop | Type | Default | Description |
|---|---|---|---|
options | (string | { value, label, disabled? })[] | - | Shorthand for <option> elements. |
placeholder | string | - | Disabled first option with an empty value; pair it with defaultValue="". |
label | ReactNode | - | Field label, wired to the control with htmlFor. |
labelPosition | "inside" | "outside" | "inside" | Small label inside the box, or a regular label above it. |
description | ReactNode | - | Helper text; linked via aria-describedby. |
error | ReactNode | boolean | - | Error message (or true for just a red border). Sets aria-invalid. |
variant | "default" | "filled" | "glass" | "default" | Visual style. Glass is for brand or image backgrounds. |
wrapperClassName | string | - | Class for the outer wrapper. className goes to the control itself. |
leftSection | ReactNode | - | Content before the value: an icon, prefix or URL stem. |
rightSection | ReactNode | chevron | Replaces the chevron. |
size | "sm" | "md" | "lg" | "md" | Controls the size. |
Every component also accepts className and forwards its ref. Root CSS class: .kivu-field