# Input

Generic text input with token-driven error styling.

[All components](https://rickylabs.github.io/netscript/design-system/components/) · [Theme builder](https://rickylabs.github.io/netscript/create/) · [Implementation source](https://github.com/rickylabs/netscript/blob/main/packages/fresh-ui/registry/components/ui/input.tsx)

## Live preview

[Open live input preview](https://rickylabs.github.io/netscript/assets/fresh-ui/preview/?component=input&theme=studio-utility)

## Install

```bash
netscript ui:add input
```

## Usage and examples

The preview runs this JSX with the installed components. Import any composed primitives from your UI directory.

```tsx
import { useState } from 'preact/hooks';
import { Input } from '@app/components/ui/input.tsx';

export function Example() {
  const [value, setValue] = useState('standard');
  const [open, setOpen] = useState(false);
  const [notice, report] = useState('');
  return (<><div><Input aria-label="Customer email" placeholder="maya@example.com" /></div><p role="status">{notice}</p></>);
}
```

## Props

Generated from native `deno doc --json --private` over the shipped implementation. Compound component props retain their owning interface; native attributes pass through where declared.

| Owner | Prop | Type | Optional | Description |
| --- | --- | --- | --- | --- |
| `InputProps` | `type` | `JSX.HTMLInputTypeAttribute` | Yes |  |
| `InputProps` | `class` | `string` | Yes |  |
| `InputProps` | `error` | `boolean` | Yes |  |

```typescript
InputProps extends Omit<JSX.InputHTMLAttributes<HTMLInputElement>, "type" | "class">
```

## Keyboard

| Key | Action |
| --- | --- |
| `Printable keys` | Edit value using native text editing |
| `Tab` | Move focus |

## Tokens

Semantic contract roles: `border/control`, `border/default`, `border/input`, `border/width`, `radius/input`, `surface/card`, `surface/muted`, `text/fg`, `text/muted`.

CSS custom properties referenced directly: Composed primitives supply their own tokens.

## Contract and compatibility

Accessibility pattern: native input

- Native DOM attributes pass through where the implementation accepts them.
- Text and value anatomy is native control content; custom adornments remain planned.

Design contract values marked planned are not implementation props. The props above describe what ships today.
