# Button

A simple button that navigates to a URL or opens/closes a modal. Use it for straightforward actions that don't need confirmation, PIN gating, or custom JavaScript — for those, use **Action Button** instead.

The Open Modal and Close Modal dropdowns are auto-populated from the modals on the current page (and the workflow's other pages), so you don't need to type modal IDs by hand.

## Available in

* Page modules
* Order Form modules
* Catalog modules
* Dashboard modules
* Public Page modules

Button isn't available in Modal, Reports, or Navigation modules.

## When to use

* A "Read more" or "Learn more" button that navigates to another page.
* A "Browse Categories" button that opens a Modal with a Category Sidebar inside.
* A "Cancel" or "Done" button inside a modal that closes it.
* Simple visual elements where appearance matters more than complex behaviour.

For form submission, use **Submit Button**. For PIN-gated, conditional, or scripted actions, use **Action Button**.

## Settings

| Setting         | Description                                                                                                                |
| --------------- | -------------------------------------------------------------------------------------------------------------------------- |
| **Label**       | Button text. Default: *Button*.                                                                                            |
| **Href**        | URL to navigate to when clicked. Used as fallback if no modal is set.                                                      |
| **Variant**     | Visual style: Primary or Secondary. Default: Primary.                                                                      |
| **Modal**       | Dropdown of modals on the current page (and workflow). Picking one makes the button open that modal.                       |
| **Close Modal** | Dropdown of modals. Picking one makes the button close that modal — typically used inside a modal as a Cancel/Done button. |

## How it works

The button's click handler resolves in this priority:

1. If **Close Modal** is set → close that modal.
2. Otherwise, if **Modal** is set → open that modal.
3. Otherwise, navigate to **Href**.

In edit mode, clicks are disabled so you can configure freely without triggering navigation.

{% hint style="info" %}
The **Modal** and **Close Modal** dropdowns are populated dynamically — they list every Modal block on the current page plus modals from the workflow's other pages. You don't need to remember modal IDs.
{% endhint %}

## Examples

**Open a category picker.** Button labelled *Browse Categories*, Modal=`category-picker`. Clicking opens the modal where the user picks a category.

**Cancel button inside a modal.** Button labelled *Cancel*, Close Modal=`category-picker`. Clicking dismisses the modal.

**External link.** Button labelled *View documentation*, Href=`https://docs.example.com`, Variant=Secondary.

## Related

<table data-view="cards"><thead><tr><th></th><th></th><th data-hidden data-card-target data-type="content-ref"></th></tr></thead><tbody><tr><td><strong>Action Button</strong></td><td>For actions with PIN gating, custom JavaScript, or conditional visibility.</td><td><a href="/pages/eJnsvUn6cKd9Lt95bP9b">/pages/eJnsvUn6cKd9Lt95bP9b</a></td></tr><tr><td><strong>Submit Button</strong></td><td>For Order Form submission.</td><td><a href="/pages/PhZ3dkc4a1LxD8vQ0aja">/pages/PhZ3dkc4a1LxD8vQ0aja</a></td></tr><tr><td><strong>Modal</strong></td><td>The block this button most commonly opens.</td><td><a href="/pages/q0VmZaW68R0qPOGtHU51">/pages/q0VmZaW68R0qPOGtHU51</a></td></tr></tbody></table>


---

# Agent Instructions: 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:

```
GET https://docs.in8sync.com/client-admin-guide/active-workflows/getting-started/content-components/button.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
