---
title: "Button"
description: "Button with variants and tones. Wraps the Polaris <s-button> web component."
canonical_url: "https://shopify.yan.ad/components/actions/button"
---
# Button

> Button with variants and tones. Wraps the Polaris <s-button> web component.

## Live preview

<polaris-preview example="button">



</polaris-preview>

## Props

<table>
<thead>
  <tr>
    <th>
      Prop
    </th>
    
    <th>
      Type
    </th>
    
    <th>
      Default
    </th>
    
    <th>
      Description
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        variant
      </code>
    </td>
    
    <td>
      <code>
        'auto' | 'primary' | 'secondary' | 'tertiary'
      </code>
    </td>
    
    <td>
      —
    </td>
    
    <td>
      Button visual style
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        tone
      </code>
    </td>
    
    <td>
      <code>
        'auto' | 'critical' | 'neutral'
      </code>
    </td>
    
    <td>
      —
    </td>
    
    <td>
      Color tone
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        disabled
      </code>
    </td>
    
    <td>
      <code>
        boolean
      </code>
    </td>
    
    <td>
      —
    </td>
    
    <td>
      Disables the button
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        loading
      </code>
    </td>
    
    <td>
      <code>
        boolean
      </code>
    </td>
    
    <td>
      —
    </td>
    
    <td>
      Shows a loading spinner
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        icon
      </code>
    </td>
    
    <td>
      <code>
        PolarisIcon
      </code>
    </td>
    
    <td>
      —
    </td>
    
    <td>
      Icon to display
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        href
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      —
    </td>
    
    <td>
      Makes the button a link
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        target
      </code>
    </td>
    
    <td>
      <code>
        'auto' | '_blank' | '_self' | '_parent' | '_top' | string
      </code>
    </td>
    
    <td>
      —
    </td>
    
    <td>
      Link target
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        download
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      —
    </td>
    
    <td>
      Download attribute for link buttons
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        type
      </code>
    </td>
    
    <td>
      <code>
        'button' | 'reset' | 'submit'
      </code>
    </td>
    
    <td>
      —
    </td>
    
    <td>
      Button type attribute
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        accessibilityLabel
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      —
    </td>
    
    <td>
      Accessible label
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        command
      </code>
    </td>
    
    <td>
      <code>
        '--auto' | '--show' | '--hide' | '--toggle'
      </code>
    </td>
    
    <td>
      —
    </td>
    
    <td>
      Command for invoketarget pattern
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        commandFor
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      —
    </td>
    
    <td>
      Target element ID for command
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        interestFor
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      —
    </td>
    
    <td>
      Target element ID for interest
    </td>
  </tr>
</tbody>
</table>

## Events

<table>
<thead>
  <tr>
    <th>
      Event
    </th>
    
    <th>
      Payload
    </th>
    
    <th>
      Description
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        click
      </code>
    </td>
    
    <td>
      <code>
        MouseEvent
      </code>
    </td>
    
    <td>
      Emitted on button click
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        focus
      </code>
    </td>
    
    <td>
      <code>
        FocusEvent
      </code>
    </td>
    
    <td>
      Emitted on focus
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        blur
      </code>
    </td>
    
    <td>
      <code>
        FocusEvent
      </code>
    </td>
    
    <td>
      Emitted on blur
    </td>
  </tr>
</tbody>
</table>

## Slots

<table>
<thead>
  <tr>
    <th>
      Slot
    </th>
    
    <th>
      Description
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        default
      </code>
    </td>
    
    <td>
      Button label
    </td>
  </tr>
</tbody>
</table>

## Polaris Element

Renders as `<s-button>`. See [Polaris Button docs](https://shopify.dev/docs/api/app-home/web-components/actions/button).


## Sitemap

See the full [sitemap](https://shopify.yan.ad/sitemap.md) for all pages.
