Skip to main content

Button

<sc-button></sc-button>

Buttons let users take actions and make choices with a single click or tap.

Click Me

Type

Use the type property to set the button's type.

DefaultPrimarySuccessInfoWarningDanger

Size

Use the size property to set the button's size.

SmallDefaultLarge

Pill

Use the pill property to make the button rounded

SmallDefaultLarge

Circle

Use the circle property to create a circular button

👍🏻👍🏻👍🏻

Loading

Click MeClick MeClick MeClick MeClick MeClick Me

Disabled

DisabledDisabledDisabledDisabledDisabledDisabled

Component Codex

Properties

PropertyDescriptionTypeDefault
autofocusTells the browser to autofocus.boolean
busyDraws the button in a busy state.booleanfalse
caretDraws the button with a caret for use with dropdowns, popovers, etc.booleanfalse
circleDraws a circle button.booleanfalse
disabledDisables the button.booleanfalse
downloadTells the browser to download the linked file as this filename. Only used when `href` is set.string
fullDraws the button full-width.booleanfalse
hrefWhen set, the underlying button will be rendered as an `<a>` with this `href` instead of a `<button>`.string
loadingDraws the button in a loading state.booleanfalse
nameAn optional name for the button. Ignored when `href` is set.string
outlineDraws an outlined button.booleanfalse
pillDraws a pill-style button with rounded edges.booleanfalse
sizeThe button's size."large" | "medium" | "small"'medium'
submitIndicates if activating the button should submit the form. Ignored when `href` is set.booleanfalse
targetTells the browser where to open the link. Only used when `href` is set."_blank" | "_parent" | "_self" | "_top"
typeThe button's type."danger" | "default" | "info" | "link" | "primary" | "success" | "text" | "warning"'default'
valueAn optional value for the button. Ignored when `href` is set.string

Events

EventDescriptionType
scBlurEmitted when the button loses focus.CustomEvent<void>
scFocusEmitted when the button gains focus.CustomEvent<void>

Shadow Parts

PartDescription
baseThe elements base wrapper.
caretThe button caret.
labelThe button label.
prefixThe button prefix.
spinnerThe button spinner.
suffixThe button suffix.

Used By