> For the complete documentation index, see [llms.txt](https://docs.realmacsoftware.com/elements-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.realmacsoftware.com/elements-docs/using-elements/components/navigation-and-interaction/button.md).

# Button

The Button component creates a prominent clickable control for navigation or actions such as opening a Modal. It supports editable text, optional content drop zones, responsive sizing, and separate normal and hover styles.

{% embed url="<https://youtu.be/4zXtboiY8nY>" %}

### How to Use Button

You’ll find Button under **Content** in the Components list.

1. Drag **Button** onto the page.
2. Edit its label directly on the page.
3. Set the destination in **Link → To**.
4. Configure text, background, border, and hover styles.
5. Optionally enable a Left or Right drop zone for an SVG, Image, or other small component.

### Component Settings

#### Link

**To** sets the destination. Choose a page, resource, website, email address, phone number, anchor, or other supported link type.

#### Font and Text Styles

**Show** displays the button label and is enabled by default.

Use **State** to style Normal and Hover text independently:

* **Color** and **Opacity** — Default to Surface 50 at 100%.
* **Text Shadow** — Defaults to None.

General controls include Align, Family, Size, Weight, Spacing, Line Height, Case, Italic, and Underline. Alignment defaults to Centre, font to Body, size to Base, weight to 400, spacing and line height to Normal, and other styles to off.

#### Dropzone

**Dropzone**

* **None** — Uses text only. This is the default.
* **Left** — Adds a drop zone before the label.
* **Right** — Adds a drop zone after the label.

**Spacing** appears when a drop zone is enabled and defaults to theme spacing 2.

#### Background

Choose None, Static, or Hover. Hover is the default and provides separate Start and End styles. Background Style can be Color, Image, or Gradient. Image controls include position, size, repeat, and fetch priority; Gradient controls include type, direction, interpolation, colour stops, opacity, and stop positions.

### Common Layout Structure for Buttons

Use a **Flex** component when you want to control a group of buttons:

1. Add a **Container**.
2. Add a **Flex** inside the Container.
3. Add two or more **Buttons** inside the Flex.

<figure><img src="/files/kwpO1AVEUxMss3VUYwQX" alt="Two centre-aligned Button components inside a Flex component"><figcaption><p>Centre-aligned Buttons inside a Flex component.</p></figcaption></figure>

Set Flex Direction to Row, Justify to Centre, and Align Items to Centre.

{% hint style="info" %}
Buttons use Auto left and right margins by default. When a Flex or Grid should control alignment and gaps, set each Button’s margins to 0. Changing Button padding does not reset its margins.
{% endhint %}

### Accessibility

Use action-oriented labels that describe the result, such as “Download Guide” rather than “Click Here”. Keep visible hover and keyboard focus states, and do not place interactive components inside a linked Button.

### Related Components

* [Flex](/elements-docs/using-elements/components/layout-components/flex.md) — Aligns and spaces groups of Buttons.
* [Modal](/elements-docs/using-elements/components/navigation-and-interaction/modal.md) — Can be opened from a Button.
* [SVG](/elements-docs/using-elements/components/content-and-media/svg.md) — Adds a custom icon through the Button drop zone.

| Common Control                                                                                                     | Description                                                             |
| ------------------------------------------------------------------------------------------------------------------ | ----------------------------------------------------------------------- |
| [Link](/elements-docs/using-elements/components/common-controls/link.md)                                           | Link to a page, resource, anchor, email address, or website.            |
| [Layout](/elements-docs/using-elements/components/common-controls/layout.md)                                       | Control positioning, stacking, visibility, overflow, and isolation.     |
| [Sizing](/elements-docs/using-elements/components/common-controls/sizing.md)                                       | Set width, height, and responsive size constraints.                     |
| [Spacing](/elements-docs/using-elements/components/common-controls/spacing.md)                                     | Add responsive margin and padding.                                      |
| [Typography & Text Styles](/elements-docs/using-elements/components/common-controls/typography-and-text-styles.md) | Control fonts, text spacing, decoration, colour, and semantic wrappers. |
| [Backgrounds](/elements-docs/using-elements/components/common-controls/backgrounds.md)                             | Apply colour, image, gradient, SVG, video, and hover backgrounds.       |
| [Transitions](/elements-docs/using-elements/components/common-controls/transitions.md)                             | Choose what animates and set its timing curve, duration, and delay.     |
| [Effects](/elements-docs/using-elements/components/common-controls/effects.md)                                     | Apply shadows, opacity, and hover effects.                              |
| [Filters](/elements-docs/using-elements/components/common-controls/filters.md)                                     | Apply blur, brightness, saturation, shadow, and backdrop effects.       |
| [Transforms](/elements-docs/using-elements/components/common-controls/transforms.md)                               | Scale, rotate, move, and skew components.                               |
| [Borders](/elements-docs/using-elements/components/common-controls/borders.md)                                     | Set border style, colour, opacity, width, radius, and hover states.     |
| [Advanced](/elements-docs/using-elements/components/common-controls/advanced.md)                                   | Add CSS classes and IDs, or change supported HTML tags.                 |


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.realmacsoftware.com/elements-docs/using-elements/components/navigation-and-interaction/button.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
