# Properties

Set what the selected element is and does: a field's type and rules, where a link opens, a picture's alternative text, a video's playback and your components' settings.

Use the **Properties** view to set what an element is and does: a field's type and its rules, where a link opens, how a picture loads, how a video plays, and the settings of a component such as a button's variant. **Styles** sets how it looks; **Properties** sets the rest, and every change is written to your code.

The Properties view of a selected email field, with its Type, Placeholder and Max length fields and the Required switch.

## What you can do

- Switch between **Styles** and **Properties** at the top of the panel.
- Set the attributes of the selected element: a field's **Type**, **Placeholder**, **Max length** and **Required**, where a link opens and its **Relation**, a picture's alternative text and **Loading**, a video's **Autoplay**, **Muted**, **Loop**, **Controls**, **Plays inline**, **Preload** and **Poster**.
- Make an element easier to use with a screen reader, in **Accessibility**.
- Change a component's settings, such as the variant and the size of a button, from a short list of choices.
- Add, remove, rename and reorder the options of a menu, the tabs of a set of tabs and the items of an accordion.
- See which values your code sets, and override one when you choose to.
- Undo any change with `Cmd/Ctrl + Z`.

## Open the Properties view

1. ### Select an element

   Click an element on the canvas or in the [Layers](/features/design/layers) panel.
2. ### Switch to Properties

   Choose **Styles** in the left rail, then **Properties** at the top of the panel. You can also choose **Properties** in the element toolbar, in the right-click menu or in the command palette. The panel stays on the view you picked when you select another element.
3. ### Change a value

   Type a value, flip a switch or pick a choice. The page updates in place, and Lyna writes the attribute to your code. A value you set shows a mark beside its name, and **Remove** with the field's name, such as **Remove Max length**, takes it off your code again. An empty field removes it too.

## Fields for each element

The fields follow the selected element, grouped under its kind (**Field**, **Button**, **Link**, **Image**, **Video**...), then **Validation**, **Attributes**, **Accessibility** and **Data attributes**. Less common fields are folded: choose **Show more** to see them, and **Show less** to fold them again.

| Element             | What you can set                                                                                                                                                                                                                                                                                                                                                            |
| ------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| A field             | **Type**, then the fields that type takes: **Placeholder**, **Min length**, **Max length** and **Pattern** for text, **Minimum**, **Maximum** and **Step** for a number or a date, **File types** for a file. **Autocomplete** offers the values that fit the type, and **Keyboard** the keyboard a phone shows. **Required**, **Disabled** and **Read only** are switches. |
| A button            | **Type** (**Button**, **Submit** or **Reset**) and **Disabled**.                                                                                                                                                                                                                                                                                                            |
| A link              | Its address and where it opens (**Same tab** or **New tab**), through **Edit link**, plus **Relation** and **Download**.                                                                                                                                                                                                                                                    |
| A picture           | Its alternative text (or **Decorative image**), **Loading** (**At once** or **When near the screen**), **Priority**, **Decoding**, **Width** and **Height**.                                                                                                                                                                                                                |
| A video or an audio | **Autoplay**, **Muted**, **Loop**, **Controls**, **Plays inline**, **Preload** and, for a video, **Poster**.                                                                                                                                                                                                                                                                |
| A form              | **Action**, **Method** and **Skip validation**.                                                                                                                                                                                                                                                                                                                             |
| Every element       | **ID**, **Title**, **Hidden**, **Tab order**, **Language**, **Direction**, and in **Accessibility** its **Role**, **Label**, **Hidden from readers**, **Expanded**, **Current**, **Pressed** and more.                                                                                                                                                                      |

A value that makes no sense is refused with the reason under its field, such as a minimum above the maximum or an address that runs script, and nothing is written. A field's **Type** decides which other fields it shows: switch it from **Text** to **Number** and **Max length** gives way to **Minimum**, **Maximum** and **Step**.

Under a group, a short note points out a problem with its fix in one click: a field with no label (**Add a label**), a link that opens a new tab without protection (**Add noopener**), or a video that plays by itself with sound, which browsers block (**Mute it**).

## Component settings

When the selected element is one of your components, its own settings come first, under its name: a button's **Variant** and **Size**, a set of tabs' default tab and **Orientation**, an accordion that opens **One at a time** or **Several at once**. Lyna reads them from the component's code, so a component you wrote shows its own settings too.

- A choice of four options or fewer is a row of buttons; a longer one is a menu. Each option is named in words, such as **Outline** or **Small**.
- **Child element** draws the component as the element inside it, such as a button that is really a link.
- When you select a part of a component, such as a tab's trigger or an accordion's item, a **Component** line names the component it belongs to: choose it to select the whole component.
- The change goes to this use only: the other uses of the component keep theirs.

The Properties view of a selected button component, with its Variant set to Outline in a row of choices and its Size menu.

When you ask Lyna AI about a selected component, it knows these settings, so "make this button smaller" picks a smaller size instead of adding styles over it.

## Options, tabs and items

A menu, a set of tabs or an accordion shows its list in the **Properties** view: **Options**, **Tabs** or **Items**.

- Choose a row to change its **Text** and **Value**.
- Choose **Add option**, **Add tab** or **Add item** to add one at the end.
- Drag a row by its handle to move it, or press `Alt` and an arrow key on the handle.
- Choose the minus button to remove a row.

Each change is written to your code in one step you can undo.

A list your code builds, for example from an array of data, has no rows to edit here: the view says **These items come from a list in the code**, with **Edit in code** and **Ask Lyna**.

The Tabs list of a selected set of tabs in the Properties view, with three rows, their drag handles and the Add tab button.

## Values set in your code

A value your code computes, such as a variable or a setting passed down from a parent component, shows the value the page renders with a **From code** badge. Open the badge to see where the value comes from, with the file and line, and choose:

- **Override with a value**: writes a fixed value in place of the code. Undo brings the code back.
- **Show in code**: opens the code panel at that line.
- **Ask Lyna**: puts a request in the chat for you to send.

A value a component sets itself, after the settings it receives, shows **Set by** and the component's name, such as **Set by Button**: a value here would never reach the element, so change it in the component with **Edit Button**, **Show in code** or **Ask Lyna**.

## On the canvas

- **Properties** in the element toolbar opens this view.
- The toolbar also shows one quick control for some elements: the **Type** of a field or a button, the **Autoplay** of a video and the **Controls** of an audio.
- A video's **Autoplay** and **Muted** take effect on the page as soon as you change them, from the panel, the toolbar, an undo or Lyna AI: no reload needed.
- On a phone, the same switch sits at the top of the **Styles** screen of the **Design** tab.

## Related

- [Styles](/features/design/styles): Size, layout, colors, text and effects of the selected element.
- [Canvas](/features/design/canvas): Select elements, edit text and see why an edit can't be applied.
- [Forms](/features/design/forms): Build a form with its fields and see what visitors send.
