--- title: Button description: Triggers actions or events, such as submitting forms, opening dialogs, or navigating to other pages. Use Button to let users perform specific tasks or initiate interactions throughout the interface. Buttons can also function as links, guiding users to internal or external destinations. api_version: 2025-10 api_name: admin-extensions source_url: html: https://shopify.dev/docs/api/admin-extensions/latest/components/actions/button md: https://shopify.dev/docs/api/admin-extensions/latest/components/actions/button.md --- # Button Triggers actions or events, such as submitting forms, opening dialogs, or navigating to other pages. Use Button to let users perform specific tasks or initiate interactions throughout the interface. Buttons can also function as links, guiding users to internal or external destinations. ## Properties * accessibilityLabel string A label that describes the purpose or contents of the Button. It will be read to users using assistive technologies such as screen readers. Use this when using only an icon or the Button text is not enough context for users using assistive technologies. * command '--auto' | '--show' | '--hide' | '--toggle' Default: '--auto' Sets the action the [command](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button#command) should take when this clickable is activated. See the documentation of particular components for the actions they support. * `--auto`: a default action for the target component. * `--show`: shows the target component. * `--hide`: hides the target component. * `--toggle`: toggles the target component. * commandFor string Sets the element the [commandFor](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button#commandfor) should act on when this clickable is activated. * disabled boolean Default: false Disables the Button meaning it cannot be clicked or receive focus. * download string Causes the browser to treat the linked URL as a download with the string being the file name. Download only works for same-origin URLs or the `blob:` and `data:` schemes. * href string The URL to link to. * If set, it will navigate to the location specified by `href` after executing the `click` event. * If a `commandFor` is set, the `command` will be executed instead of the navigation. * icon "" | "replace" | "search" | "split" | "link" | "edit" | "product" | "variant" | "collection" | "select" | "info" | "incomplete" | "complete" | "color" | "money" | "adjust" | "affiliate" | "airplane" | "alert-bubble" | "alert-circle" | "alert-diamond" | "alert-location" | "alert-octagon" | "alert-octagon-filled" | "alert-triangle" The type of icon to be displayed in the Button. * interestFor string Sets the element the [interestFor](https://open-ui.org/components/interest-invokers.explainer/#the-pitch-in-code) should act on when this clickable is activated. * loading boolean Default: false Replaces content with a loading indicator while a background action is being performed. This also disables the Button. * target "auto" | AnyString | "\_blank" | "\_self" | "\_parent" | "\_top" Default: 'auto' Specifies where to display the linked URL. * tone "critical" | "auto" | "neutral" Default: 'auto' Sets the tone of the Button based on the intention of the information being conveyed. * type "button" | "reset" | "submit" Default: 'button' The behavior of the Button. * `submit`: Used to indicate the component acts as a submit button, meaning it submits the closest form. * `button`: Used to indicate the component acts as a button, meaning it has no default action. * `reset`: Used to indicate the component acts as a reset button, meaning it resets the closest form (returning fields to their default values). This property is ignored if the component supports `href` or `commandFor`/`command` and one of them is set. * variant "auto" | "primary" | "secondary" | "tertiary" Default: 'auto' - the variant is automatically determined by the Button's context Changes the visual appearance of the Button. ### AnyString Prevents widening string literal types in a union to \`string\`. ```ts string & {} ``` ## Events Learn more about [registering events](https://shopify.dev/docs/api/app-home/using-polaris-components#event-handling). * blur CallbackEventListener\ | null * click CallbackEventListener\ | null * focus CallbackEventListener\ | null ### CallbackEventListener ```ts (EventListener & { (event: CallbackEvent): void; }) | null ``` ### CallbackEvent ```ts Event & { currentTarget: HTMLElementTagNameMap[T]; } ``` ## Slots * children HTMLElement The content of the Button. ### Examples * #### Code ##### jsx ```jsx <> Add Product Save Theme ``` ##### html ```html Add Product Save Theme ``` ## Examples Component examples ### Basic usage Basic usage Demonstrates a simple button with default styling, automatically determining its visual variant and using a clear, action-oriented label. Variants Showcases different button variants with varying visual emphasis, helping merchants understand action priorities through distinct styling. Tones Illustrates button tones that signal the semantic importance and potential impact of different actions through color and styling. With icon Showcases a button that combines a descriptive text label with an intuitive icon, enhancing visual communication of the action. Icon-only button Demonstrates an icon-only button with an accessibility label, providing a compact interface that remains screen reader friendly. Loading state Illustrates buttons in various loading states, providing visual feedback during asynchronous operations. Form states Demonstrates buttons in different interaction states, showing how to represent disabled controls and submit actions within forms. Link buttons Showcases buttons that act as hyperlinks, supporting navigation to different pages, external resources, and file downloads. Form submission buttons Demonstrates a button group with carefully aligned actions, showing how to create a clear visual hierarchy for form submission and cancellation. Delete confirmation Illustrates a button pair for destructive actions, using a critical tone to emphasize the potentially irreversible nature of the operation. Navigation button with icon Showcases a navigation button with an icon, enabling quick access to different sections of the interface. Button group for bulk operations Demonstrates a button group for executing operations on multiple selected items. Icon-only buttons with labels Showcases a set of compact, icon-only buttons with accessibility labels, perfect for creating dense interfaces. Component interactions Demonstrates advanced button capabilities using `command`, `commandFor`, and `interestFor` properties to enable dynamic component communication. ### Examples * #### Basic usage ##### Description Demonstrates a simple button with default styling, automatically determining its visual variant and using a clear, action-oriented label. ##### jsx ```jsx Save ``` ##### html ```html Save ``` * #### Variants ##### Description Showcases different button variants with varying visual emphasis, helping merchants understand action priorities through distinct styling. ##### jsx ```jsx Primary Secondary Tertiary Auto ``` ##### html ```html Primary Secondary Tertiary Auto ``` * #### Tones ##### Description Illustrates button tones that signal the semantic importance and potential impact of different actions through color and styling. ##### jsx ```jsx Delete Save draft Continue ``` ##### html ```html Delete Save draft Continue ``` * #### With icon ##### Description Showcases a button that combines a descriptive text label with an intuitive icon, enhancing visual communication of the action. ##### jsx ```jsx Add product ``` ##### html ```html Add product ``` * #### Icon-only button ##### Description Demonstrates an icon-only button with an accessibility label, providing a compact interface that remains screen reader friendly. ##### jsx ```jsx ``` ##### html ```html ``` * #### Loading state ##### Description Illustrates buttons in various loading states, providing visual feedback during asynchronous operations. ##### jsx ```jsx Saving product... Updating 247 variants... Processing shipment... ``` ##### html ```html Saving product... Updating 247 variants... Processing shipment... ``` * #### Form states ##### Description Demonstrates buttons in different interaction states, showing how to represent disabled controls and submit actions within forms. ##### jsx ```jsx Save draft Save product ``` ##### html ```html Save draft Save product ``` * #### Link buttons ##### Description Showcases buttons that act as hyperlinks, supporting navigation to different pages, external resources, and file downloads. ##### jsx ```jsx View products Help docs Export data ``` ##### html ```html View products Help docs Export data ``` * #### Form submission buttons ##### Description Demonstrates a button group with carefully aligned actions, showing how to create a clear visual hierarchy for form submission and cancellation. ##### jsx ```jsx Cancel Save product ``` ##### html ```html Cancel Save product ``` * #### Delete confirmation ##### Description Illustrates a button pair for destructive actions, using a critical tone to emphasize the potentially irreversible nature of the operation. ##### jsx ```jsx Cancel Delete variant ``` ##### html ```html Cancel Delete variant ``` * #### Navigation button with icon ##### Description Showcases a navigation button with an icon, enabling quick access to different sections of the interface. ##### jsx ```jsx View orders ``` ##### html ```html View orders ``` * #### Button group for bulk operations ##### Description Demonstrates a button group for executing operations on multiple selected items. ##### jsx ```jsx Export selected Delete selected ``` ##### html ```html Export selected Delete selected ``` * #### Icon-only buttons with labels ##### Description Showcases a set of compact, icon-only buttons with accessibility labels, perfect for creating dense interfaces. ##### jsx ```jsx ``` ##### html ```html ``` * #### Component interactions ##### Description Demonstrates advanced button capabilities using \`command\`, \`commandFor\`, and \`interestFor\` properties to enable dynamic component communication. ##### jsx ```jsx {/* Button that navigates using Shopify's navigation system. Use shopify:navigate for navigation. Refer to [handling navigation events](/docs/api/app-home?accordionItem=getting-started-existing-remix-application) for implementation details and framework-specific examples. */} Edit details {/* Button that expresses interest in specific data */} Bulk edit ``` ##### html ```html Edit details Bulk edit ```