Components
Input
A surface-first text input built on Base UI's Input primitive, with filled and outlined variants, shapes, sizes, leading addons, and inline button/badge support.
import { Input } from "@/components/ui/input";
export default function Particle() {
return <Input className="w-72" placeholder="Enter your email" type="email" />;
}
Installation
pnpm dlx shadcn@latest add @taut-ui/input
Usage
import { Input } from "@/components/ui/input"<Input placeholder="Enter your email" type="email" />Examples
Outline
import { Input } from "@/components/ui/input";
export default function Particle() {
return (
<Input
className="w-72"
placeholder="Enter your email"
type="email"
variant="outline"
/>
);
}
Rounded
import { Input } from "@/components/ui/input";
export default function Particle() {
return <Input className="w-72" placeholder="Rounded input" shape="rounded" />;
}
Small
import { Input } from "@/components/ui/input";
export default function Particle() {
return <Input className="w-72" placeholder="Small input" size="sm" />;
}
Large
import { Input } from "@/components/ui/input";
export default function Particle() {
return <Input className="w-72" placeholder="Large input" size="lg" />;
}
With Leading Icon
import { SearchIcon } from "lucide-react";
import { Input } from "@/components/ui/input";
export default function Particle() {
return (
<Input
className="w-72"
placeholder="Search components…"
startAddon={<SearchIcon />}
type="search"
/>
);
}
Password Toggle
"use client";
import { EyeIcon, EyeOffIcon } from "lucide-react";
import { useState } from "react";
import { Button } from "@/components/ui/button";
import { Input } from "@/components/ui/input";
export default function Particle() {
const [visible, setVisible] = useState(false);
return (
<Input
className="w-72"
defaultValue="s3cr3t-p@ss"
placeholder="Password"
type={visible ? "text" : "password"}
>
<Button
aria-label={visible ? "Hide password" : "Show password"}
onClick={() => setVisible((prev) => !prev)}
size="icon"
variant="ghost"
>
{visible ? <EyeOffIcon /> : <EyeIcon />}
</Button>
</Input>
);
}
Invalid
import { Input } from "@/components/ui/input";
export default function Particle() {
return (
<Input
aria-invalid="true"
className="w-72"
defaultValue="invalid-email"
placeholder="Enter your email"
type="email"
/>
);
}
Disabled
import { Input } from "@/components/ui/input";
export default function Particle() {
return <Input className="w-72" disabled placeholder="Disabled input" />;
}
File
import { Input } from "@/components/ui/input";
export default function Particle() {
return <Input className="w-72" type="file" />;
}
API Reference
Input
Wraps Base UI Input inside a styled container that automatically sizes trailing buttons, badges, and leading addons.
| Prop | Type | Default | Description |
|---|---|---|---|
variant | "filled" | "outline" | "outlined" | "filled" | "filled" uses a solid tonal surface; "outline" adds an inset border |
shape | "pill" | "round" | "rounded" | "square" | "pill" | Border-radius shape of the container and nested buttons/badges |
size | "sm" | "default" | "md" | "lg" | number | "default" | Height and padding preset; pass a number to forward the HTML size attribute |
startAddon | React.ReactNode | - | Leading element (such as an icon) rendered before the input |
children | React.ReactNode | - | Trailing elements (buttons, badges, icons) rendered inside the container |
unstyled | boolean | false | Suppresses default variant styling on the outer wrapper |
nativeInput | boolean | false | Renders a plain <input> instead of Base UI's Input primitive |
className | string | - | Additional CSS classes applied to the outer container |
...props | Base UI Input props | - | All standard input attributes (type, disabled, aria-invalid, etc.) |
inputVariants
A cva helper exported for composing consistent input surfaces in other components (such as AutocompleteInput).