button
button(
opts?):void
Defined in: components/button.ts:87
A button. Tonal and outlined variants show a border; filled variants rely on their solid background for affordance.
Shortcut: pass a string to use it as the label, or a function for custom content.
Tip: pair href with Aberdeen’s interceptLinks() (called once at app
startup) for SPA-style navigation without manual click handlers:
import {interceptLinks} from from "aberdeen/route";interceptLinks(); // once at rootS.button({ href: "/dashboard", content: "Dashboard" }); // navigates via routerParameters
Section titled “Parameters”Returns
Section titled “Returns”void
Example
Section titled “Example”S.button({ content: "Save", click: S.alert("Saved.") });S.button({ content: "Cancel", attrs: ".neutral", click: cancel }); // neutral buttonS.button({ content: "Delete", attrs: ".danger .outlined", click: del });S.button("Cancel"); // shorthand for { content: "Cancel" }S.button({ href: "/docs", content: "Docs" }); // renders an <a role=button>