Navigated to /docs/ui/actions-and-navigation

Actions and navigation

Use Button, Link, navigation menus, breadcrumbs, and pagination with their exact rendering and state contracts.

Button rendering, loading, and defaults

  • Defaults are variant=solid, tone=primary, size=md, loading=false, disabled=false, iconOnly=false, and native type=button.

  • loading disables the action, renders a spinner, and exposes aria-busy=true.

  • iconOnly changes sizing but does not create an accessible name. Supply label or aria-label.

  • href is forwarded only when the root is an anchor or a custom component. It does not change the root by itself.

  • A disabled non-button loses href, receives aria-disabled=true, and is removed from sequential keyboard navigation.

TSX
tsximport { Button, Icon } from "@tavojs/ui";

<Button type="submit" loading={saving}>Save changes</Button>
<Button as="a" href="/settings" variant="soft">Settings</Button>
<Button iconOnly label="Add project"><Icon viewBox="0 0 24 24" /></Button>