Text input with a built-in label, helper text, validation and side sections.
import { Input } from "@kivu-ui/react"On this page
import { Input } from "@kivu-ui/react";import { Input } from "@kivu-ui/react";
export default function Demo() {
return <Input label="Project name" placeholder="Brand refresh" className="w-full" wrapperClassName="w-full max-w-sm" />;
}By default the label sits inside the box. Set labelPosition="outside" for a classic label.
import { Input } from "@kivu-ui/react";
export default function Demo() {
return (
<div className="grid w-full max-w-xl gap-4 sm:grid-cols-2">
<Input label="Inside (default)" placeholder="you@example.com" />
<Input label="Outside" labelPosition="outside" placeholder="you@example.com" />
</div>
);
}Add prefixes, units or icons.
import { Input } from "@kivu-ui/react";
export default function Demo() {
return (
<div className="grid w-full max-w-xl gap-4 sm:grid-cols-2">
<Input label="Workspace URL" leftSection="field.app/" defaultValue="studio" />
<Input label="Hourly rate" rightSection="USD/h" inputMode="decimal" defaultValue="85" />
</div>
);
}Both are connected to the input with aria-describedby.
We'll send the invite here.
Project name is required
import { Input } from "@kivu-ui/react";
export default function Demo() {
return (
<div className="grid w-full max-w-xl gap-4 sm:grid-cols-2">
<Input label="Email" description="We'll send the invite here." />
<Input label="Project name" error="Project name is required" />
</div>
);
}import { Input } from "@kivu-ui/react";
export default function Demo() {
return (
<div className="grid w-full gap-4 sm:grid-cols-3">
<Input label="Default" />
<Input label="Filled" variant="filled" />
<div className="rounded-kivu-lg bg-primary-600 p-3">
<Input label="Glass" variant="glass" />
</div>
</div>
);
}Extends all <input> attributes except size.
| Prop | Type | Default | Description |
|---|---|---|---|
label | ReactNode | - | Field label, wired to the control with htmlFor. |
labelPosition | "inside" | "outside" | "inside" | Small label inside the box, or a regular label above it. |
description | ReactNode | - | Helper text; linked via aria-describedby. |
error | ReactNode | boolean | - | Error message (or true for just a red border). Sets aria-invalid. |
variant | "default" | "filled" | "glass" | "default" | Visual style. Glass is for brand or image backgrounds. |
wrapperClassName | string | - | Class for the outer wrapper. className goes to the control itself. |
leftSection | ReactNode | - | Content before the value: an icon, prefix or URL stem. |
rightSection | ReactNode | - | Content after the value: a unit or icon. |
size | "sm" | "md" | "lg" | "md" | Controls the size. |
className | string | - | Extra classes; Tailwind utilities override the component's styles. |
Every component also accepts className and forwards its ref. Root CSS class: .kivu-field