A native text field with optional content at the start and end. Supports standard input attributes, events, form submission, controlled values, and refs.
Use an Input.Label child with position="top", "left", "right", "bottom", or "inside", following the same pattern as Select and Checkbox. The default is top. Place the label directly inside Input.Root; it is automatically associated with the native input, including when you supply your own id.
<Flex gap="4" wrap="wrap" align="center" justify="center" className="w-full" direction="column"><Input.Rootname="email"type="email"placeholder="you@example.com"><Input.Labelposition="top">Email</Input.Label></Input.Root><Input.Rootplaceholder="Enter a name"><Input.Labelposition="left">Name</Input.Label></Input.Root><Input.Rootplaceholder="Enter a username"><Input.Labelposition="right">Username</Input.Label></Input.Root><Input.Rootplaceholder="Enter a city"><Input.Labelposition="bottom">City</Input.Label></Input.Root><Input.Rootplaceholder="Search…"><Input.Labelposition="inside">Search</Input.Label></Input.Root></Flex>
Slots
Use startSlot and endSlot for icons, text, or other components. Components inside slots retain their own spacing. Interactive slot content stays keyboard accessible. Give icon buttons an accessible name, use type="button" for actions that should not submit a form, and hide decorative icons with aria-hidden="true".
Wrap either slot's content in Input.Slot to give it an independent outlined, solid, muted, or clear treatment. Slots inherit the Input.Root variant by default; set a slot’s variant to override it, including variant="clear" for an unstyled slot. Slots keep zero margin and padding by default; use spacing props such as px="2" when you want padding. Outlined slots draw only an inner divider in the field’s border color, and solid slots use the base solid background. Muted slots inherit the field’s accent color unless you set their own color. The field clips slot content to its outer rounded corners.
Input.Slot accepts className, style, standard div attributes, a forwarded ref, and the shared color, margin, and padding props. The .input-slot-content class styles the slot content; .input-slot[data-side="start"] and .input-slot[data-side="end"] identify the layout wrappers.
Use native disabled and readOnly props. Set aria-invalid and associate error text with aria-describedby for invalid values. Set disabled on any slot buttons separately when they should be disabled too.