Buttons

Buttons are interactive elements that link to external resources or other pages. Each button can include an icon and, by default, opens links in a new tab.

Properties

PropTypeDefaultDescription
titlestringrequiredThe label shown on the button.
hrefstringrequiredThe URL the button links to.
iconstring—Icon shown before the label. Accepts a built-in icon key (Phosphor or Simple Icons) or a custom URL.
variant'primary' 'secondary'primaryVisual style of the button.
target'_blank' '_self'_blankWhere the link opens. _blank adds rel="noopener noreferrer" automatically.

Examples

Basic Button

<scalar-button
  title="View Documentation"
  href="https://docs.scalar.com">
</scalar-button>
<Button
  title="View Documentation"
  href="https://docs.scalar.com"
/>

Button with Icon

<scalar-button
  title="Download SDK"
  href="https://github.com/scalar/scalar"
  icon="phosphor/regular/download">
</scalar-button>
<Button
  title="Download SDK"
  href="https://github.com/scalar/scalar"
  icon="phosphor/regular/download"
/>

Secondary Variant

<scalar-button
  title="Learn More"
  href="https://scalar.com"
  variant="secondary">
</scalar-button>
<Button
  title="Learn More"
  href="https://scalar.com"
  variant="secondary"
/>