Primitives

Input, Select, Checkbox, Switch

Import#

Everything comes from the package root. The example above uses:

your-component.tsx
import {
  Checkbox,
  Input,
  Label,
  Select,
  SelectContent,
  SelectItem,
  SelectTrigger,
  SelectValue,
  Switch,
  Textarea,
} from "@waveinno/ui";

Props#

Read from the source of this version, so they match the code exactly.

<Checkbox>

src/components/ui/checkbox.tsx

Also takes ComponentPropsWithoutRef<typeof CheckboxPrimitive.Root> (passed through).

<Input>

src/components/ui/input.tsx
PropTypeDefaultDescription
state"default" | "error" | "warning" | "success""default"
leadingReact.ReactNode—Icon or text inside the box, before the value (a search icon, "৳", "+880").
trailingReact.ReactNode—After the value: a unit, a clear button, a status icon.

Also takes InputHTMLAttributes<HTMLInputElement>.

<Label>

src/components/ui/label.tsx
PropTypeDefaultDescription
requiredboolean—

Also takes ComponentPropsWithoutRef<typeof LabelPrimitive.Root>.

<SelectContent>

src/components/ui/select.tsx

Also takes ComponentPropsWithoutRef<typeof SelectPrimitive.Content> (passed through).

<SelectItem>

src/components/ui/select.tsx

Also takes ComponentPropsWithoutRef<typeof SelectPrimitive.Item> (passed through).

<SelectTrigger>

src/components/ui/select.tsx

Also takes ComponentPropsWithoutRef<typeof SelectPrimitive.Trigger> (passed through).

<Switch>

src/components/ui/switch.tsx

Also takes ComponentPropsWithoutRef<typeof SwitchPrimitive.Root> (passed through).

<Textarea>

src/components/ui/input.tsx
PropTypeDefaultDescription
state"default" | "error" | "warning" | "success""default"

Also takes TextareaHTMLAttributes<HTMLTextAreaElement>.

Install#

If the project does not have the package yet, add it, then follow the setup for Next.js or Vite once.

$ npm install @waveinno/ui