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.
"use client";
import {
Checkbox,
Input,
Label,
Select,
SelectContent,
SelectItem,
SelectTrigger,
SelectValue,
Switch,
Textarea,
} from "@waveinno/ui";
import * as React from "react";
export default function FormFields() {
const [on, setOn] = React.useState(true);
return (
<div className="grid max-w-xl gap-4 sm:grid-cols-2">
<div className="space-y-1.5">
<Label htmlFor="pg-name">Name</Label>
<Input id="pg-name" placeholder="Karim Ahmed" />
</div>
<div className="space-y-1.5">
<Label>City</Label>
<Select defaultValue="dhaka">
<SelectTrigger>
<SelectValue />
</SelectTrigger>
<SelectContent>
<SelectItem value="dhaka">Dhaka</SelectItem>
<SelectItem value="ctg">Chattogram</SelectItem>
<SelectItem value="sylhet">Sylhet</SelectItem>
</SelectContent>
</Select>
</div>
<div className="space-y-1.5 sm:col-span-2">
<Label htmlFor="pg-note">Note</Label>
<Textarea id="pg-note" placeholder="Anything the team should know" />
</div>
<label className="flex items-center gap-2 text-sm text-body">
<Checkbox defaultChecked /> Send a receipt
</label>
<label className="flex items-center gap-2 text-sm text-body">
<Switch checked={on} onCheckedChange={setOn} /> Notifications {on ? "on" : "off"}
</label>
</div>
);
}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.
"use client";
import { Input, Label } from "@waveinno/ui";
export default function FormFieldsInputExample() {
return (
<div className="w-full max-w-xs space-y-1.5">
<Label htmlFor="ex-name">Full name</Label>
<Input id="ex-name" placeholder="Karim Ahmed" />
</div>
);
}Input with icons
An icon before says what goes in; something after can act on it.
"use client";
import { Input } from "@waveinno/ui";
import { CircleCheck, Mail, Search } from "lucide-react";
export default function FormFieldsInputIconsExample() {
return (
<div className="w-full max-w-xs space-y-3">
<Input placeholder="Plate, phone or ticket" leading={<Search />} />
<Input type="email" placeholder="karim@gulshanparking.com" leading={<Mail />} trailing={<CircleCheck className="text-success" />} />
</div>
);
}Prefix and suffix
Units and currency sit in the field, so the number stays a number.
"use client";
import { Input, Label } from "@waveinno/ui";
export default function FormFieldsInputAffixExample() {
return (
<div className="w-full max-w-xs space-y-1.5">
<Label htmlFor="ex-cap">Daily cap</Label>
<Input id="ex-cap" defaultValue="1,200" leading="৳" trailing="per day" />
</div>
);
}States
Error, warning and success, each with its message. Error is announced to screen readers.
Enter all 11 digits.
Higher than usual.
Verified
"use client";
import { FormField, Input } from "@waveinno/ui";
export default function FormFieldsInputStatesExample() {
return (
<div className="grid w-full max-w-xl gap-4 sm:grid-cols-3">
<FormField label="Mobile" htmlFor="ex-e" error="Enter all 11 digits.">
<Input id="ex-e" defaultValue="01712-34" state="error" />
</FormField>
<FormField label="Daily cap" htmlFor="ex-w" warning="Higher than usual.">
<Input id="ex-w" defaultValue="৳12,000" state="warning" />
</FormField>
<FormField label="Email" htmlFor="ex-s" success="Verified">
<Input id="ex-s" defaultValue="karim@gulshan.com" state="success" />
</FormField>
</div>
);
}Disabled and read-only
Disabled cannot be used; read-only can be read and copied.
"use client";
import { Input } from "@waveinno/ui";
import { Lock } from "lucide-react";
export default function FormFieldsInputDisabledExample() {
return (
<div className="grid w-full max-w-md gap-3 sm:grid-cols-2">
<Input disabled placeholder="Not available" />
<Input readOnly defaultValue="GUL-2025-0042" leading={<Lock />} />
</div>
);
}Textarea with a counter
For notes: the counter warns before the limit, not after.
"use client";
import { FormField, Textarea } from "@waveinno/ui";
export default function FormFieldsTextareaExample() {
return (
<div className="w-full max-w-md">
<FormField label="Note for the team" htmlFor="ex-note" count={{ value: 43, max: 60 }}>
<Textarea id="ex-note" defaultValue="Leave the car with the attendant at lane 2." />
</FormField>
</div>
);
}Select
A short list to pick one from. For long lists, use the Combobox.
"use client";
import { Label, Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "@waveinno/ui";
export default function FormFieldsSelectExample() {
return (
<div className="w-full max-w-xs space-y-1.5">
<Label>City</Label>
<Select defaultValue="dhaka">
<SelectTrigger>
<SelectValue />
</SelectTrigger>
<SelectContent>
<SelectItem value="dhaka">Dhaka</SelectItem>
<SelectItem value="ctg">Chattogram</SelectItem>
<SelectItem value="sylhet">Sylhet</SelectItem>
<SelectItem value="khulna">Khulna</SelectItem>
</SelectContent>
</Select>
</div>
);
}Select with a placeholder
Nothing chosen yet: the placeholder says what to choose.
Decides the hourly rate.
"use client";
import { FormField, Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "@waveinno/ui";
export default function FormFieldsSelectPlaceholderExample() {
return (
<div className="w-full max-w-xs">
<FormField label="Vehicle type" hint="Decides the hourly rate.">
<Select>
<SelectTrigger>
<SelectValue placeholder="Choose a vehicle" />
</SelectTrigger>
<SelectContent>
<SelectItem value="car">Car</SelectItem>
<SelectItem value="bike">Motorbike</SelectItem>
<SelectItem value="micro">Microbus</SelectItem>
</SelectContent>
</Select>
</FormField>
</div>
);
}Checkbox
On, off, and the in-between state for 'some of these'.
"use client";
import { Checkbox } from "@waveinno/ui";
export default function FormFieldsCheckboxExample() {
return (
<div className="space-y-2.5">
<label className="flex items-center gap-2.5 text-sm text-body">
<Checkbox defaultChecked /> Send a receipt
</label>
<label className="flex items-center gap-2.5 text-sm text-body">
<Checkbox /> Remember this card
</label>
<label className="flex items-center gap-2.5 text-sm text-body">
<Checkbox checked="indeterminate" /> Some levels selected
</label>
<label className="flex items-center gap-2.5 text-sm text-muted">
<Checkbox disabled /> Not available on this plan
</label>
</div>
);
}Checkbox with a description
When the choice needs a sentence of explanation.
"use client";
import { Checkbox } from "@waveinno/ui";
export default function FormFieldsCheckboxDescriptionExample() {
return (
<label className="flex max-w-sm cursor-pointer items-start gap-3">
<Checkbox defaultChecked className="mt-0.5" />
<span>
<span className="block text-[14px] font-medium text-text">Daily report by email</span>
<span className="block text-[13px] text-muted">Cars in, cars out and takings, every evening at 9.</span>
</span>
</label>
);
}Switch
For settings that take effect at once. Use a checkbox when there is a Save button.
"use client";
import { Switch } from "@waveinno/ui";
export default function FormFieldsSwitchExample() {
return (
<div className="space-y-3">
<label className="flex items-center gap-2.5 text-sm text-body">
<Switch defaultChecked /> Notifications
</label>
<label className="flex items-center gap-2.5 text-sm text-muted">
<Switch disabled /> Not available
</label>
</div>
);
}Settings row
A title, a line about it, and the switch at the end of the row.
"use client";
import { Switch } from "@waveinno/ui";
export default function FormFieldsSwitchRowExample() {
return (
<div className="w-full max-w-md divide-y divide-border rounded-[calc(12px*var(--radius-scale,1))] border border-border bg-raised">
{[
["Open the gate for pass holders", "Cameras read the plate.", true],
["Text the driver a receipt", "৳0.25 per message.", false],
].map(([title, line, on]) => (
<label key={title as string} className="flex cursor-pointer items-center justify-between gap-4 p-4">
<span>
<span className="block text-[14px] font-medium text-text">{title}</span>
<span className="block text-[12.5px] text-muted">{line}</span>
</span>
<Switch defaultChecked={on as boolean} />
</label>
))}
</div>
);
}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.
"use client";
export default function FloatingLabelExample() {
return (
<div className="relative w-full max-w-xs">
<input
id="fl-email"
type="email"
placeholder=" "
className="peer h-12 w-full rounded-[calc(10px*var(--radius-scale,1))] border border-border2 bg-raised px-3 pt-4 text-[14px] text-text outline-none transition-[border-color,box-shadow] duration-200 focus:border-primary focus:ring-2 focus:ring-primary/20"
/>
<label
htmlFor="fl-email"
className="pointer-events-none absolute left-3 top-1/2 -translate-y-1/2 text-[14px] text-muted transition-all duration-200 ease-out peer-focus:top-3.5 peer-focus:text-[11px] peer-focus:text-primary peer-[:not(:placeholder-shown)]:top-3.5 peer-[:not(:placeholder-shown)]:text-[11px]"
>
Email address
</label>
</div>
);
}Focus glowFree
A soft brand glow spreads round the field when it takes focus.
"use client";
import { Input } from "@waveinno/ui";
import { Search } from "lucide-react";
export default function FormFieldsFocusGlowExample() {
return (
<div className="w-full max-w-xs">
<Input
placeholder="Search car parks"
leading={<Search />}
className="transition-[box-shadow,border-color] duration-300 focus:shadow-[0_0_0_4px_color-mix(in_srgb,var(--primary)_14%,transparent),0_10px_28px_-10px_color-mix(in_srgb,var(--brand-1)_60%,transparent)]"
/>
</div>
);
}Switch that says savedFree
Flip it and a tick pops in: the setting took effect.
"use client";
import { Switch } from "@waveinno/ui";
import { Check } from "lucide-react";
import * as React from "react";
export default function SwitchSavedExample() {
const [on, setOn] = React.useState(false);
const [saved, setSaved] = React.useState(0);
return (
<label className="flex w-full max-w-sm cursor-pointer items-center justify-between gap-4 rounded-[calc(12px*var(--radius-scale,1))] border border-border bg-raised p-4">
<span>
<span className="block text-[14px] font-medium text-text">Open the gate for pass holders</span>
<span className="mt-0.5 flex h-5 items-center gap-1 text-[12.5px] text-muted">
{saved ? (
<span key={saved} className="inline-flex animate-wv-pop items-center gap-1 text-success">
<Check className="size-3.5" /> Saved
</span>
) : (
"Cameras read the plate"
)}
</span>
</span>
<Switch
checked={on}
onCheckedChange={(v) => {
setOn(v);
setSaved((n) => n + 1);
}}
/>
</label>
);
}Border beam on focus Pro
A beam of brand colour runs round the field while it has focus: for AI and search boxes.
This example's code comes with Wavi Pro
One payment for every Pro component, block and template, with every update.
Drawn checkbox Pro
The tick draws itself in, stroke by stroke.
This example's code comes with Wavi Pro
One payment for every Pro component, block and template, with every update.
Elastic switch Pro
The thumb stretches while pressed and springs across, in the brand gradient.
This example's code comes with Wavi Pro
One payment for every Pro component, block and template, with every update.
Import#
Everything comes from the package root. The example above uses:
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.tsxAlso takes ComponentPropsWithoutRef<typeof CheckboxPrimitive.Root> (passed through).
<Input>
src/components/ui/input.tsx| Prop | Type | Default | Description |
|---|---|---|---|
state | "default" | "error" | "warning" | "success" | "default" | |
leading | React.ReactNode | — | Icon or text inside the box, before the value (a search icon, "৳", "+880"). |
trailing | React.ReactNode | — | After the value: a unit, a clear button, a status icon. |
Also takes InputHTMLAttributes<HTMLInputElement>.
<Label>
src/components/ui/label.tsx| Prop | Type | Default | Description |
|---|---|---|---|
required | boolean | — |
Also takes ComponentPropsWithoutRef<typeof LabelPrimitive.Root>.
<SelectContent>
src/components/ui/select.tsxAlso takes ComponentPropsWithoutRef<typeof SelectPrimitive.Content> (passed through).
<SelectItem>
src/components/ui/select.tsxAlso takes ComponentPropsWithoutRef<typeof SelectPrimitive.Item> (passed through).
<SelectTrigger>
src/components/ui/select.tsxAlso takes ComponentPropsWithoutRef<typeof SelectPrimitive.Trigger> (passed through).
<Switch>
src/components/ui/switch.tsxAlso takes ComponentPropsWithoutRef<typeof SwitchPrimitive.Root> (passed through).
<Textarea>
src/components/ui/input.tsx| Prop | Type | Default | Description |
|---|---|---|---|
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