# Text field
**This documentation is fully rendered on the
[Material Web catalog](https://material-web.dev/components/text-field/)**
[Text fields](https://m3.material.io/components/text-fields) let
users enter text into a UI.
* [Design article](https://m3.material.io/components/text-fields)
* [API Documentation](#api)
* [Source code](https://github.com/material-components/material-web/tree/main/textfield)
## Types
1. [Filled text field](#filled-text-field)
1. [Outlined text field](#outlined-text-field)
## Usage
Text fields behave like
[``](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input)
elements. They provide a container with labels for user input.

```html
```
### Input type
A text field's `type` attribute changes how the text field works, such as
displaying a different keyboard or providing default validation.
- [`type="text"`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/text)
(default)
- [`type="email"`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/email)
- [`type="number"`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/number)
- [`type="password"`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/password)
- [`type="search"`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/search)
- [`type="tel"`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/tel)
- [`type="url"`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/url)
- [`type="textarea"`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/textarea)

```html
```
> Tip: use the
> [`inputmode`](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/inputmode)
> attribute for more control over the displayed keyboard.
### Labels
Text fields should label their value with a floating `label`, a `placeholder`,
or an external label. Labels help the user understand what value to input.

```html
First name
```
> Note: text fields do not currently support `aria-labelledby`. External labels
> must provide an `aria-label`. See b/276484803.
### Textarea
Multi-line text fields behave like
[`