# Input

- **[Atoms](/components/)**

A single-line text field with the system's border, focus ring and invalid state.

## When to use

- **Use for**: Short free text: a name, an email, a search.
- **Not for**: Long answers. Use Textarea.
- **Pairs with**: Always inside a Field.

## Preview

input.tsx

```
import { Theme } from '@/components/klarhimmel/theme/style';
import { Input, Field } from '@/components/klarhimmel/ui/input';

export default function Example() {
  return (
    <Theme theme="brand">
      <Field label="Email" hint="We reply within a day.">
        {(p) => <Input type="email" {...p} />}
      </Field>
    </Theme>
  );
}
```

## Import

- **CLI**

  ```
  npx shadcn add @klarhimmel/input
  ```
- **Import**

  ```
  import { Input } from '@/components/klarhimmel/ui/input';
  ```

- **Files**: input.tsx, in components/klarhimmel/ui/. With it: button, editing, theme, utils.
- **Render in**: Render it inside <Theme>, once near the root of your app. Tokens and fonts are scoped to it, so outside it the component is unstyled.

## Examples

- **Field**

  ```
  import { Field, Input } from '@/components/klarhimmel/ui/input';
  
  export default function InputField() {
    return (
      <Field label="Email" hint="We only use it to reply." className="w-full max-w-xs">
        {(p) => <Input {...p} type="email" placeholder="you@example.com" />}
      </Field>
    );
  }
  ```

## Props

- **...input**: Every native input attribute is passed through.
- **className**: Extra classes, merged after the component's own.

## Accessibility

- Tab · Moves into and out of the field

[Accessibility](/get-started/accessibility)

[Previous](/components/copy-button)

[Next](/components/textarea)
