# Input

A single line of text, with its label, its helper and its error.

Group: Forms. Code: `components/software/form.tsx`. From the old system: Input in @id-identity-as/ui/form. Live: https://design.id-hub.dk/software/input

```tsx
import { Input } from '@/components/software/form';

<Input label="Firma" name="company" autoComplete="organization" required />
<Input label="CVR-nummer" name="cvr" autoComplete="off" inputMode="numeric" helper="Otte cifre uden mellemrum." />
<Input label="E-mail" name="email" type="email" autoComplete="email" required error="Skriv en e-mailadresse, fx mette@firma.dk" />
```

| Prop | Type | Default | What it does |
| --- | --- | --- | --- |
| label (required) | `string` |  | The visible label. Never a placeholder. |
| name (required) | `string` |  | The form field name. |
| autoComplete (required) | `AutoCompleteToken` |  | An HTML autocomplete token such as "email" or "organization", or "off" as the explicit refusal. |
| helper | `string` |  | Guidance shown under the field when there is no error. |
| error | `string` |  | What to do about a problem. Its presence puts the field in its error state. |
| required | `boolean` |  | Required fields carry no mark. The optional ones are marked. |
| optionalLabel | `string` | `'(valgfrit)'` | The mark on an optional field. Pass a translation here. |
| ...input | `InputHTMLAttributes` |  | Everything a native input takes: type, inputMode, defaultValue, onChange, disabled. |

Do:
- Choose the autocomplete token. "off" is a real answer for a number that belongs to one order.
- Write the error as what to do: "Skriv alle 8 cifre", not "Ugyldigt CVR".
- Set type and inputMode, so a phone shows the right keyboard.

Do not:
- Do not use the placeholder as the label.
- Do not colour an error red. The edge doubles in the text colour and the message is set in the heading weight.
- Do not post a form to DynamicWeb from a React field. DynamicWeb takes native inputs in its own templates.

Accessibility:
- A native input with a real label.
- In error it has aria-invalid, and aria-describedby points at the error; otherwise at the helper. Never both.
- The edge of the field is Stone: at least 3:1 against the surface in light and dark.

Tokens it uses:
- color.surface.base
- color.text.default
- color.neutral.500
- color.text.muted
- radius.sm
- type.body.md
- type.body.sm
- type.heading.sm
- space.inline.2
- component.field.padding-top
- component.field.padding-bottom
- component.field.padding-x

---

Not drawn in Figma. Kasper decided on 20 November 2026 that internal software gets this set now, built only from the tokens. The look is ours until Peter draws it, and every open choice is a question in docs/SPOERGSMAAL-TIL-PETER.md. The public site, campaigns and brand surfaces use only the components drawn in Figma.

The rules for this set and all 33 components: https://design.id-hub.dk/software.md. Token values: https://design.id-hub.dk/tokens.md.

Index of everything, as text: https://design.id-hub.dk/llms.txt. Never invent a colour, a size, a component or a product fact: if it is not here, it does not exist yet.
