# Input

Displays a form input field or a component that looks like an input field.

> For the complete documentation index, see [llms.txt](/llms.txt). Markdown variants are available by appending `.md` to any URL or sending an `Accept: text/markdown` header. An agent skill is available at [/.well-known/agent-skills/site-skill.md](/.well-known/agent-skills/site-skill.md).





<ComponentPreview name="input-demo">
  <InputDemo />
</ComponentPreview>

## Installation [#installation]

<Tabs defaultValue="cli">
  <TabsList>
    <TabsTrigger value="cli">
      CLI
    </TabsTrigger>

    <TabsTrigger value="manual">
      Manual
    </TabsTrigger>
  </TabsList>

  <TabsContent value="cli">
    ```bash
    npx shadcn@latest add https://shadcn-cssinjs.com/r/input.json
    ```
  </TabsContent>

  <TabsContent value="manual">
    <Steps>
      <Step>
        Install the following dependencies:
      </Step>

      ```bash
      pnpm add @stylexjs/stylex
      ```

      <Step>
        Make sure [StyleX is configured](/docs/installation) and the design tokens are
        installed.
      </Step>

      <Step>
        Copy and paste the following code into your project.
      </Step>

      <ComponentSource name="input" title="input.tsx" />

      <Step>
        Update the import paths to match your project setup.
      </Step>
    </Steps>
  </TabsContent>
</Tabs>

## Usage [#usage]

```tsx
import { Input } from "@/components/ui/input/input";
```

```tsx
<Input type="email" placeholder="Email" />
```

## Examples [#examples]



### Basic [#basic]

<ComponentPreview name="input-basic">
  <InputBasic />
</ComponentPreview>

### Label [#label]

Pair the input with a `label` element.

<ComponentPreview name="input-label">
  <InputLabel />
</ComponentPreview>

### Field [#field]

Compose the input with a `Field` for labels and descriptions.

<ComponentPreview name="input-field">
  <InputField />
</ComponentPreview>

### Field Group [#field-group]

<ComponentPreview name="input-fieldgroup">
  <InputFieldGroup />
</ComponentPreview>

### Disabled [#disabled]

<ComponentPreview name="input-disabled">
  <InputDisabled />
</ComponentPreview>

### Invalid [#invalid]

<ComponentPreview name="input-invalid">
  <InputInvalid />
</ComponentPreview>

### File [#file]

<ComponentPreview name="input-file">
  <InputFile />
</ComponentPreview>

### Inline [#inline]

<ComponentPreview name="input-inline">
  <InputInline />
</ComponentPreview>

### Grid [#grid]

<ComponentPreview name="input-grid">
  <InputGrid />
</ComponentPreview>

### Required [#required]

<ComponentPreview name="input-required">
  <InputRequired />
</ComponentPreview>

### Badge [#badge]

<ComponentPreview name="input-badge">
  <InputBadge />
</ComponentPreview>

### Button Group [#button-group]

<ComponentPreview name="input-button-group">
  <InputButtonGroup />
</ComponentPreview>



### Input Group [#input-group]

<ComponentPreview name="input-input-group">
  <InputInputGroup />
</ComponentPreview>



## RTL [#rtl]

To enable right-to-left support, see the [RTL guide](/docs/rtl).

<ComponentPreview name="input-rtl" direction="rtl">
  <InputRtl />
</ComponentPreview>
