Esc
Documentation
On this page

Props

PropTypeDefaultDescription
label requiredstring | FieldReferenceNoneButton text
actionActionTarget | FieldReferenceNoneAction to execute on click
successLinkTableRowLinkNoneNavigate after success
linkstring | FieldReferenceNoneURL to navigate to
overlaystringNoneOpen a host overlay surface by its contribution ID, when the host supports it
successOverlaystringNoneOpen an overlay only after the action succeeds
iconstring | FieldReferenceNoneIcon name
descriptionstring | FieldReferenceNoneTooltip text
kbdstring | FieldReferenceNoneKeyboard shortcut hint
confirmation| { title: string; description: string; confirmLabel?: string; } | FieldReferenceNoneConfirmation dialog before execution
variant"primary" | "secondary" | "danger" | "list-item""secondary"Visual style

Example

ts
Button({ label: "Submit", action: save(), variant: "primary" })

Button({
  label: "Delete",
  action: deleteItem({ id: row.id }),
  variant: "danger",
  confirmation: { title: "Delete item?", description: "This cannot be undone." },
})

View the source on GitHub