2024-12-17 15:17:25 -05:00
|
|
|
---
|
2024-12-20 17:44:10 -05:00
|
|
|
title: Input
|
|
|
|
|
description: Inputs collect data from the user.
|
|
|
|
|
tags: forms
|
2024-12-20 11:22:13 -05:00
|
|
|
icon: input
|
2024-12-20 17:44:10 -05:00
|
|
|
component: input
|
2024-12-17 18:06:33 -05:00
|
|
|
elements:
|
|
|
|
|
"<input>": https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input
|
2025-01-28 16:58:53 -05:00
|
|
|
file: styles/native/input.css
|
2024-12-17 15:17:25 -05:00
|
|
|
---
|
2024-12-20 17:44:10 -05:00
|
|
|
|
2024-12-20 09:45:23 -05:00
|
|
|
## Text Fields
|
2024-12-17 16:22:11 -05:00
|
|
|
|
|
|
|
|
```html {.example}
|
|
|
|
|
<label>Input (text) <input type="text" placeholder="placeholder"></label>
|
2024-12-17 15:17:25 -05:00
|
|
|
<wa-input label="WA Input (text)" type="text" placeholder="placeholder"></wa-input>
|
|
|
|
|
|
2024-12-17 16:22:11 -05:00
|
|
|
<label>Input (number) <input type="number"></label>
|
2024-12-17 15:17:25 -05:00
|
|
|
<wa-input label="WA Input (number)" type="number"></wa-input>
|
|
|
|
|
|
2024-12-17 16:22:11 -05:00
|
|
|
<label>Input (password) <input type="password" required></label>
|
2024-12-17 15:17:25 -05:00
|
|
|
<wa-input label="WA Input (password)" type="password" required></wa-input>
|
|
|
|
|
|
2024-12-17 16:22:11 -05:00
|
|
|
<label>Input (email) <input type="email"></label>
|
2024-12-17 15:17:25 -05:00
|
|
|
<wa-input label="WA Input (email)" type="email"></wa-input>
|
|
|
|
|
|
2024-12-17 16:22:11 -05:00
|
|
|
<label>Input (search) <input type="search"></label>
|
2024-12-17 15:17:25 -05:00
|
|
|
<wa-input label="WA Input (search)" type="search"></wa-input>
|
|
|
|
|
|
2024-12-17 16:22:11 -05:00
|
|
|
<label>Input (tel) <input type="tel"></label>
|
2024-12-17 15:17:25 -05:00
|
|
|
<wa-input label="WA Input (tel)" type="tel"></wa-input>
|
|
|
|
|
|
2024-12-17 16:22:11 -05:00
|
|
|
<label>Input (url) <input type="url"></label>
|
2024-12-17 15:17:25 -05:00
|
|
|
<wa-input label="WA Input (url)" type="url"></wa-input>
|
2024-12-17 16:22:11 -05:00
|
|
|
```
|
2024-12-17 15:17:25 -05:00
|
|
|
|
2025-03-12 12:19:50 -04:00
|
|
|
## Pill shaped text fields
|
|
|
|
|
|
|
|
|
|
Add the `wa-pill` class to an `<input>` to make it pill-shaped.
|
|
|
|
|
|
|
|
|
|
```html {.example}
|
|
|
|
|
<label>Input <input type="text" placeholder="placeholder" class="wa-pill"></label>
|
|
|
|
|
```
|
|
|
|
|
|
2024-12-20 09:45:23 -05:00
|
|
|
## Color Picker
|
2024-12-17 15:17:25 -05:00
|
|
|
|
2024-12-19 10:16:14 -05:00
|
|
|
Basic:
|
|
|
|
|
|
2024-12-17 16:22:11 -05:00
|
|
|
```html {.example}
|
2024-12-19 10:16:14 -05:00
|
|
|
<label>Input (color) <input type="color" value="#ff0066"></label>
|
|
|
|
|
<wa-color-picker label="WA Color Picker" value="#ff0066"></wa-color-picker>
|
|
|
|
|
```
|
2024-12-17 16:22:11 -05:00
|
|
|
|
2024-12-19 10:16:14 -05:00
|
|
|
With swatches:
|
|
|
|
|
|
|
|
|
|
```html {.example}
|
|
|
|
|
<label>Input (color) <input type="color" value="#ff0066" list="swatches"></label>
|
|
|
|
|
<datalist id="swatches">
|
|
|
|
|
<option value="#0070ef">Web Awesome Blue</option>
|
|
|
|
|
<option>#f5a623</option>
|
|
|
|
|
<option>#f8e71c</option>
|
|
|
|
|
<option>#8b572a</option>
|
|
|
|
|
<option>#7ed321</option>
|
|
|
|
|
<option>#417505</option>
|
|
|
|
|
<option>#bd10e0</option>
|
|
|
|
|
<option>#9013fe</option>
|
|
|
|
|
</datalist>
|
|
|
|
|
|
|
|
|
|
<wa-color-picker label="WA Color Picker" value="#ff0066"
|
|
|
|
|
swatches="#0070ef; #f5a623; #f8e71c; #8b572a; #7ed321; #417505; #bd10e0; #9013fe;"></wa-color-picker>
|
2024-12-17 16:22:11 -05:00
|
|
|
```
|
2024-12-17 15:17:25 -05:00
|
|
|
|
2024-12-20 09:45:23 -05:00
|
|
|
## Time and Date Pickers
|
2024-12-17 15:17:25 -05:00
|
|
|
|
2024-12-17 16:22:11 -05:00
|
|
|
```html {.example}
|
|
|
|
|
<label>Input (datetime-local) <input type="datetime-local"></label>
|
|
|
|
|
<wa-input label="WA Input (datetime-local)" type="datetime-local"></wa-input>
|
|
|
|
|
|
|
|
|
|
<label>Input (date) <input type="date"></label>
|
|
|
|
|
<wa-input label="WA Input (date)" type="date"></wa-input>
|
2024-12-17 15:17:25 -05:00
|
|
|
|
2024-12-17 16:22:11 -05:00
|
|
|
<label>Input (time) <input type="time"></label>
|
|
|
|
|
<wa-input label="WA Input (time)" type="time"></wa-input>
|
|
|
|
|
```
|
|
|
|
|
|