FormField

Label + children + hint/error.

Optional hint

Input & SearchInput

Textarea

Select & Searchable Dropdown

Native select and searchable dropdown with filter-by-typing.

Checkbox & Switch

Radio

Radio Group

Radio with label and optional hint.

Choose one

Optional hint

FileUpload

Slider

50

Combobox

How to use

Form-related components from the UI library. Copy the examples below.

1. Import

tsx
import {
  FormField,
  Input,
  SearchInput,
  Textarea,
  Select,
  SearchableDropdown,
  Checkbox,
  Switch,
  Radio,
  RadioGroup,
  FileUpload,
  Slider,
  Combobox,
} from "@/app/components/ui";

2. FormField

tsx
<FormField label="Field" hint="Optional hint">
  <Input placeholder="Inside FormField" />
</FormField>
<FormField label="Required" error="This field is required">
  <Input />
</FormField>

3. Input

tsx
<Input placeholder="Placeholder" />
<Input placeholder="Disabled" disabled />

4. SearchInput

tsx
<SearchInput placeholder="Search..." />

5. Textarea

tsx
<Textarea label="Message" placeholder="Enter text..." rows={3} />

6. Select

tsx
const options = [
  { value: "1", label: "Option 1" },
  { value: "2", label: "Option 2" },
];

<Select label="Choose" options={options} placeholder="Select..." />

7. SearchableDropdown

tsx
const countryOptions = [
  { value: "us", label: "United States" },
  { value: "uk", label: "United Kingdom" },
];

<SearchableDropdown
  label="Country"
  options={countryOptions}
  value={value}
  onChange={setValue}
  placeholder="Select country..."
  searchPlaceholder="Search..."
/>

8. Checkbox & Switch

tsx
<Checkbox label="Accept terms" />
<Switch checked={checked} onCheckedChange={setChecked} label="Toggle" />

9. Radio

tsx
<Radio
  name="demo"
  options={[
    { value: "a", label: "Option A" },
    { value: "b", label: "Option B" },
  ]}
  value={value}
  onChange={setValue}
/>

10. RadioGroup

tsx
<RadioGroup
  name="radiogroup"
  label="Choose one"
  options={[
    { value: "opt1", label: "Option 1" },
    { value: "opt2", label: "Option 2" },
  ]}
  value={value}
  onChange={setValue}
  hint="Optional hint"
/>

11. FileUpload

tsx
<FileUpload label="Upload" hint="Drag and drop or click" />

12. Slider

tsx
<Slider value={value} onValueChange={setValue} min={0} max={100} />
<span>{value}</span>

13. Combobox

tsx
<Combobox
  value={value}
  onChange={setValue}
  open={open}
  onOpenChange={setOpen}
  options={["Apple", "Banana", "Cherry"]}
  placeholder="Type or choose..."
  label="Fruit"
/>