Button

An action. Seven variants and four sizes; pending shows it working. In a page it runs an action reference on click.

Example

tsx
<Stack direction="row" gap="sm" wrap align="center">
  <Button variant="primary">Primary</Button>
  <Button>Default</Button>
  <Button variant="secondary">Secondary</Button>
  <Button variant="outline">Outline</Button>
  <Button variant="ghost">Ghost</Button>
  <Button variant="link">Link</Button>
  <Button variant="destructive">Delete</Button>
  <Button size="sm">Small</Button>
  <Button pending>Saving</Button>
</Stack>

Usage

Pages are built on the server: import the tags from @dash/server and return the tree. The browser runtime draws it.
tsx
import { Button, Stack } from "@dash/server";

Props

ButtonProps

Also takes everything ButtonHTMLAttributes<HTMLButtonElement> does.
Prop
Type
Description
variant"default" | "primary" | "secondary" | "outline" | "ghost" | "link" | "destructive"
size"sm" | "md" | "lg" | "icon"
disabledboolean
type"button" | "submit" | "reset"
pendingbooleanAn action started by this control is in flight: shows a spinner and ignores presses.
onClickReact.MouseEventHandler<HTMLButtonElement>
PreviousMark
NextInput
On this page