---
schema_version: "1"
id: 2e90770e0f2c8007495c5ca3d50a64e285c82d2f43f0558564ca45b9388dc627
title: Forms, Fields, and Labels
collection: developer
version: current
locale: en-us
portal_url: https://docs.salesforce.com/developer/current/en-us/platform/aura-platform/guides/aura/accessibility/accessibility-forms.md
canonical_url: https://developer.salesforce.com/docs/platform/aura-platform/guide/accessibility-forms.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: 5ce9dc6280b0c88d6bc0f0b37dba45620ed3d91ebd7078eeb7dc2b131229a51f
products:
  - Lightning Aura Components Developer Guide
  - Platform Developer Content
---

# Forms, Fields, and Labels

Input components are designed to make it easy to assign labels to form fields. Labels build a programmatic relationship between a form field and its textual label. When using a placeholder in an input component, set the `label` attribute for accessibility.

Use `lightning:input` to create accessible input fields and forms. You can use `lightning:textarea` in preference to the `<textarea>` tag for multi-line text input or `lightning:select` instead of the `<select>` tag.

<!-- otherprops: set_clipboard -->
```nolang
<lightning:input name="myInput" label="Search" />
```

If your code fails, check the label element during component rendering. The label element’s `for` attribute must match the value of the input control’s `id` attribute. Alternatively, wrap the label around an input. Input controls include `<input>`, `<textarea>`, and `<select>`.

Here’s an example of the HTML generated by `lightning:input`.

<!-- otherprops: set_clipboard -->
```nolang
<!-- Use label/for -->
<label for="fullname">Enter your full name:</label>
<input type="text" id="fullname" />

<!-- Use an implicit label -->
<label>Enter your full name:
    <input type="text" id="fullname"/>
</label>
```

**See Also**  


-   [Using Labels](https://developer.salesforce.com/docs/platform/aura-platform/labels/labels-intro.md)
-   [Creating a Form](https://developer.salesforce.com/docs/platform/aura-platform/slds/lightning-base-form.md)
-   [*Component Library*: lightning:input documentation](https://developer.salesforce.com/docs/component-library/bundle/lightning:input)
-   [*Component Library*: lightning:textarea documentation](https://developer.salesforce.com/docs/component-library/bundle/lightning:textarea)

