Select

Scroll AreaSeparator

Custom dropdown select with labels, hints and validation.

Used for billing.

Installation

pnpm add krz-ui

Usage

import { Select } from "krz-ui";
<Select
  label="Country"
  placeholder="Choose a country"
  options={[
    { value: "ae", label: "United Arab Emirates" },
    { value: "in", label: "India" },
  ]}
  onValueChange={setCountry}
/>

API Reference

PropTypeDescription
optionsSelectOption[]Options with value, label and disabled.
value / defaultValuestringControlled or initial value.
placeholderstringShown when nothing is selected.
label / hint / errorReactNodeField label, helper text and error message.
onValueChange(value: string) => voidCalled with the selected value.
size"sm" | "md" | "lg"Field size.
leftIconReactNodeIcon inside the field.
name / required / disabledstring / booleanForm name (hidden input), required and disabled state.
className / style / ref—className and style go on the whole field; ref and native attributes go to the trigger button. See Customization.
classNames{ label?, control?, icon?, message?, trigger?, value?, list?, option? }Extra classes for inner parts.