Primitives

Input, Select, Checkbox, Switch

The everyday controls: one height, one focus ring, labels that click through, and states that never make the form jump.

12 examples 6 animated · 3 Pro Code and Figma for each

Examples#

Each one on its own: copy its code into your app, or copy it to Figma and paste it on the canvas as layers.

Input

A label and a field. Clicking the label focuses the field.

Input with icons

An icon before says what goes in; something after can act on it.

Prefix and suffix

Units and currency sit in the field, so the number stays a number.

৳per day

States

Error, warning and success, each with its message. Error is announced to screen readers.

Higher than usual.

Verified

Disabled and read-only

Disabled cannot be used; read-only can be read and copied.

Textarea with a counter

For notes: the counter warns before the limit, not after.

43/60

Select

A short list to pick one from. For long lists, use the Combobox.

Select with a placeholder

Nothing chosen yet: the placeholder says what to choose.

Decides the hourly rate.

Checkbox

On, off, and the in-between state for 'some of these'.

Checkbox with a description

When the choice needs a sentence of explanation.

Switch

For settings that take effect at once. Use a checkbox when there is a Save button.

Settings row

A title, a line about it, and the switch at the end of the row.

Animated#

Motion that earns its place: free ones to copy now, and Pro ones whose code and Figma copy come with a Wavi Pro licence. They respect the visitor's reduced-motion setting.

Floating labelFree

The label rests inside the field and floats up on focus or once there is a value.

Focus glowFree

A soft brand glow spreads round the field when it takes focus.

Switch that says savedFree

Flip it and a tick pops in: the setting took effect.

Border beam on focus Pro

A beam of brand colour runs round the field while it has focus: for AI and search boxes.

Drawn checkbox Pro

The tick draws itself in, stroke by stroke.

Elastic switch Pro

The thumb stretches while pressed and springs across, in the brand gradient.

Night rates on

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