Buttons

Buttons are interactive elements that create clickable links to external resources. They're perfect for directing users to documentation, downloads, or any external URL. Each button can include an icon and opens links in a new tab for better user experience.

Properties

title

string required

The text displayed on the button. This is the primary label that users will see and click on.

href

string required

The URL that the button links to. When clicked, this will open in a new tab with proper security attributes (rel="noopener noreferrer").

icon

string optional

An icon to display alongside the button text. Can be either a path to a local Scalar icon or a URL to an external icon. If not provided, the button will display only text.

Examples

Basic Button

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

Button with Icon

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

Button with External Icon

link icon Visit Website
<scalar-button
  title="Visit Website"
  href="https://scalar.com"
  icon="https://scalar.com/logo-dark.svg">
</scalar-button>
link icon Visit Website
::scalar-button{ title="Visit Website" href="https://scalar.com" icon="https://scalar.com/logo-dark.svg"}