# Inputs

One control for each type of input: the type tells the browser the keyboard, the picker and the check.

Every control is a native element: the browser owns the state, the keyboard, the validation and the submission, with or without JavaScript. LUZ does not mark a field invalid: add `.luz-input--error`, `aria-invalid="true"` and the error text. A field wraps a control in `.luz-field`:

Field wrapper markup
```html
<div class="luz-field">
  <label class="luz-field__label" for="name">Project name</label>
  <input class="luz-input" id="name" type="text" aria-describedby="name-hint name-error">
  <div class="luz-field__helper" id="name-hint">Shown on the dashboard.</div>
  <div class="luz-field__error" id="name-error"><span class="u-sr-only">Error: </span>Use letters, numbers and dashes only.</div>
</div>
```

### Text
A single-line field for a short answer you cannot list in advance, such as a name.

```html
<input class="luz-input" id="name" type="text" aria-describedby="name-hint">
```

### Email
A field for an email address: the browser checks its shape and phones show the at sign.

```html
<input class="luz-input" id="email" type="email" autocomplete="email" required aria-describedby="email-hint">
```

### Password
A field that hides what is typed, for a password or another secret.

```html
<input class="luz-input" id="password" type="password" autocomplete="current-password" minlength="8" required aria-describedby="password-hint">
```

### Search
A text field for words to look for, with a search key on phone keyboards and a clear button in some browsers.

```html
<form role="search">
  <div class="luz-field">
    <label class="luz-field__label" for="search">Search the docs</label>
    <input class="luz-input" id="search" type="search" name="q" enterkeyhint="search" aria-describedby="search-hint">
    <div class="luz-field__helper" id="search-hint">Search by name or topic.</div>
  </div>
  <button type="submit">Search</button>
</form>
```

### Telephone
A field for a phone number: phones show a number keypad, and the browser checks no format.

```html
<input class="luz-input" id="tel" type="tel" autocomplete="tel" aria-describedby="tel-hint">
```

### URL
A field for a web address: the browser checks for a scheme such as https:// and phones show a slash key.

```html
<input class="luz-input" id="url" type="url" autocomplete="url" placeholder="https://example.com" aria-describedby="url-hint">
```

### Number
A field for a quantity counted or adjusted in steps, with spin buttons and a range check.

```html
<input class="luz-input" id="number" type="number" min="1" max="10" step="1" value="1" aria-describedby="number-hint">
```

### Date
A field for a calendar date, with the browser's own picker. The value is always year-month-day.

```html
<input class="luz-input" id="date" type="date" min="2026-01-01" max="2026-12-31" aria-describedby="date-hint">
```

### Time
A field for a time of day, in the reader's 12 or 24 hour clock, as hours and minutes.

```html
<input class="luz-input" id="time" type="time" value="09:00" aria-describedby="time-hint">
```

### Date and time
A field for a day and a time together. The value has no time zone.

```html
<input class="luz-input" id="datetime-local" type="datetime-local" min="2026-01-01T08:00" aria-describedby="datetime-local-hint">
```

### Month
A field for a month and a year, such as a card's expiry. The value is year-month.

```html
<input class="luz-input" id="month" type="month" min="2026-01" max="2026-12" placeholder="YYYY-MM" pattern="[0-9]{4}-[0-9]{2}" aria-describedby="month-hint">
```

### Week
A field for a week of a year, such as 2026-W24, for planning by week.

```html
<input class="luz-input" id="week" type="week" min="2026-W01" max="2026-W52" placeholder="YYYY-Www" pattern="[0-9]{4}-W[0-9]{2}" aria-describedby="week-hint">
```

### Color
A swatch that opens the system's color picker. The value is a hex color, #rrggbb.

```html
<input class="luz-input" id="color" type="color" value="#0066cf">
```

### File
A button that opens the system's file chooser, and the name of the chosen file.

```html
<form method="post" enctype="multipart/form-data">
  <div class="luz-field">
    <label class="luz-field__label" for="file">Attachment</label>
    <input class="luz-input" id="file" type="file" accept=".pdf,.png" aria-describedby="file-hint">
    <div class="luz-field__helper" id="file-hint">PDF or PNG, up to 5 MB.</div>
  </div>
  <button type="submit">Upload</button>
</form>
```

### Range
A slider for a value on a scale, the place of the thumb matters more than the exact number.

```html
<div class="luz-field">
  <label class="luz-field__label" for="volume">Volume <output class="luz-output" id="volume-out" for="volume">50</output></label>
  <input class="luz-input" id="volume" type="range" min="0" max="100" value="50">
</div>
```

### Textarea
A field for text of more than one line, such as a message or a description.

```html
<textarea class="luz-input luz-input--textarea" id="textarea" rows="4" maxlength="500" aria-describedby="textarea-hint"></textarea>
```

### Known issues
None known.
