description: Displays a form input field or a component that looks like an input field.
toc:
- label: Usage
id: usage
- label: Examples
id: examples
children:
- label: Default
id: example-default
- label: Invalid
id: example-invalid
- label: Disabled
id: example-disabled
- label: With label
id: example-with-label
- label: With text
id: example-with-text
- label: With button
id: example-with-button
- label: Form
id: example-form
---
{% from "macros/code_preview.njk" import code_preview %}
{% from "macros/code_block.njk" import code_block %}
{% set code %}<input class="input" type="email" placeholder="Email">{% endset %}
{{ code_preview("input", code) }}
<h2 id="usage">Usage</h2>
<section class="prose my-6">
<p>Simply add the <code>input</code> class to your <code><input></code> element or have a parent with the <code>form</code> class (<a href="/components/form">read more about form</a>). You can also set the <code>aria-invalid</code> attribute to <code>true</code> to make the input invalid.</p>