# [Usage](../../../usage.md) > [Components and standard attributes](../basics.md) > name

---
`name` | `->setName()`

Will set the name of the component. Normally, is advised to use the `::make()` method to directly set the name. Learn more [here](make.md).

- In `Form` components it set the name attribute for the field, if no name is set then the `uuid` will override it. Be sure to always set the name for your form component or it will not be easly retrieved.
- In `Visual` components, setting the name will override the `label` attribute and display it instead, for example, a Button name is also its label.

| Types    | Default |
|----------|---------|
| `string` | `null`  |

Identity for data mapping (Form fields) and display fallback (Visuals). On Form fields it becomes the HTML name / submit key; on Visuals (e.g. Button) it doubles as label when `label` is empty. When omitted the framework falls back to the auto-generated `uuid`, which makes retrieval hard — always set it for form fields.
Prefer `::make('name')` shorthand; `setName` overrides it.

### Example
Blade:
```php
{!! \KFramework\Components\Forms\Input::make()->setName('email') !!}
```
Controller:
```php
Input::make()->setName('email');
Input::make('email')->setLabel('E-mail');
```

### Interaction / tips
- Keys `values` (../shared_attributes/values.md) / `defaults` (../shared_attributes/defaults.md) maps; mismatched names are ignored.
- Visual `label` (../shared_attributes/label.md) is overridden by `name` when both are set.
- Unnamed fields fall back to `uuid` (../shared_attributes/uuid.md); see `make` (../shared_attributes/make.md).

See also: [make](make.md), [uuid](uuid.md), [label](label.md), [value](value.md), [basics](../basics.md), [Input](../forms/input.md).