Input
Enter a single line of text or a native input value.
Installation
pnpm dlx shadcn@4.18.0 add @siteplane/inputComplete the one-time setup first. Registry JSON lists source files and dependencies.
For this page’s examples, also install:
pnpm dlx shadcn@4.18.0 add @siteplane/action-icons @siteplane/button @siteplane/input-groupUsage
import { Input } from "@/siteplane/components/input";
<Input aria-label="Description" />;Variants
Choose the control surface without changing its behavior. elevated lifts the field with the hairline and soft shadow of an elevated Card, so it reads on a white surface too. soft replaces the border with a subtle fill.
Sizes
Omit size to inherit the provider's control size. The text is 14px, or 16px at xl; textSize sets it at any size. Touch screens always use 16px text.
Disabled, read-only and invalid
disabled blocks editing; readOnly keeps the value focusable and submitted. Set invalid on Field and explain the problem with FieldError.
File input
type="file" keeps the native file picker. Its button and file name sit on the center of the field, with the height and start padding of any other input at each size. Uploading the selected file is up to your application.
PDF or image, up to 10 MB.
Password
type="password" masks the value as larger, evenly spaced dots at the field’s own text size. They come from a font with a bigger bullet, Verdana or DejaVu Sans on Linux; on a system with neither, such as Android, the dots keep the text font’s size and only the spacing opens up. The placeholder and the revealed text keep the normal text style.
To let people show or hide the value, put the input in an InputGroup with an icon Button, as below. Password visibility describes the pattern.
Controlled value
Pass value and onValueChange to own the text, for example to show how many characters remain. maxLength limits entry natively.
32 characters left
Floating label
Put the Input in a Field with labelPlacement="floating" and its label sits inside the field until it has focus or a value; Field lists the controls that support it. Floating fields take no leading icon, so an Input with insetStart keeps its label above it.
We send the receipt here.
API reference
| Prop | Type | Default | Description |
|---|---|---|---|
size | sm | md | lg | xl | number | provider / lg | Visual control size. A number sets native input size instead. |
text | sm | base | unset | Text size at any control size: sm is 14px, base is 16px. Unset uses 14px, or 16px at xl; touch screens use 16px. |
variant | default | elevated | inset | soft | default | Surface treatment. |
unstyled | boolean | false | Removes the outer surface recipe; preserves control anatomy. |
class | string | unset | Styles the outer span, not the native control. |
native | boolean | false | Renders a native input element with the same Field wiring as the default input. |
render | ReactElement<input props> | unset | Renders the supplied input element with the input classes; takes precedence over nativeInput. Inside a Field it is connected like the default input. |
hide | boolean | false | Hides the native picker affordance; supply another understandable interaction when needed. |
inset | boolean | false | Marks an edge as inset for a composed adjoining element. |
on | (value, eventDetails) => void | unset | Text-change callback; native onChange also fires. |
InputProps and InputPrimitive are exported. style reaches the actual input, including callback styles. renderInput preserves its own className alongside the input classes; props set on the supplied element take precedence over Input props.
Inside a Field, nativeInput and renderInput are wired like the default input: FieldLabel labels the rendered input, FieldDescription and FieldError describe it, and Field state such as invalid and disabled reaches it.
Other input, form and validation props follow Base UI Input.
Usage notes
Always provide a visible label or an accessible name. Placeholder text is not a label. Use Field for related help and errors. type="search" hides the browser's built-in clear button, type="date" keeps the native picker (hidePickerIndicator hides its icon), and type="hidden" renders only the native input. A controlled input does not reset with its form; reset your state in onReset. The control does not persist data or implement request loading. A plain native form and the kit Form have different validation presentation; see Forms.