Button

A button that sends its onClick event. With href it opens the URL, and with copy it copies the text, both without the agent. Use variant "primary" for the one main Button in a Row, and the default for the others. With submit true inside a Form, it submits the Form. The child or children render instead of the label. With checks, it is disabled while a check fails.

Examples

Loading examples…

Props

PropTypeDescription
labelstringThe button text
checksobject[]Validation rules. The control shows the first failed one
textstringSame as label. Used when label is not set
variant"default" | "primary" | "soft" | "borderless"Default "default": outlined. "primary" is filled, for the one main action. "borderless" has no box, like a link
color"primary" | "secondary" | "danger"Default "primary"
size"sm" | "md" | "lg"Default "lg"
blockbooleanFull width
weightnumberflex-grow in a Row or Column
pillbooleanDefault true
disabledboolean
loadingboolean
submitbooleanSubmits the Form around it. The Form sends its onSubmit event
iconstringLucide icon name
uniformbooleanA square button, for an icon
hrefstringOpens this URL in a new tab on click, instead of onClick
copystringCopies this text to the clipboard on click and shows a check mark, instead of onClick

Slots

  • child · single
  • children · multiple

Events

  • onClick · Sent when the user clicks the button.

Link to Button · All standard components

On this page