Skip to content

    Browse components

    Input

    Text input with icon slots, three sizes, a focus line that sweeps out from the center and an error state that shakes and slides in its message.

    Open
    Customize

    sm
    md
    lg

    Installation

    npx shadcn@latest add @glint-ui/input

    First time using @glint-ui? Add the registry to components.json once, or install by URL: npx shadcn@latest add https://glintui.vercel.app/r/input.json

    Usage

    import { Input } from "@/components/ui/input";
    
    <Input placeholder="Email" startIcon={<AtSign />} error={invalid && "Enter a valid email"} />

    Props

    PropTypeDefaultDescription
    placeholderstring"Search components..."Placeholder text. All native input props are forwarded.
    size"sm" | "md" | "lg""md"Height, padding and text size.
    errorstring""Error message (or true) marks the field invalid and links the message via aria-describedby.
    disabledbooleanfalseDisable the input.
    startIconReactNode—Icon before the value.
    endIconReactNode—Icon, text or small button after the value.
    classNamestring—Extra classes for the root element.