Skip to content
  • System
  • Light
  • Dark
  • High contrast

Button

The most important action on a page.

import { Button } from '@eekodigital/raster';

<Button>Save report</Button>
<Button size="sm">Save report</Button>
<Button size="lg">Save report</Button>

Supporting or lower-priority actions.

<Button variant="secondary">Cancel</Button>
<Button variant="secondary" size="sm">Cancel</Button>

Destructive or irreversible actions.

<Button variant="danger">Delete project</Button>
<Button disabled>Save report</Button>
<Button variant="secondary" disabled>Cancel</Button>

Why does this exist? An <a> inside a <button> is invalid HTML. Passing a render prop applies button styles to any element — typically a router Link — so the rendered HTML is a single <a>, not a button wrapping a link.

// Navigates to a new page → use render prop + Link
<Button>
  {(props) => <Link to="/projects/new" {...props}>New project</Link>}
</Button>

// Submits a form → plain button
<Button type="submit">Create project</Button>
PropTypeDefaultDescription
variant’primary’ | ‘secondary’ | ‘danger''primary’Visual style
size’sm’ | ‘md’ | ‘lg''md’Button size
childrenReactNode | (props) => ReactNode

Pass a render prop to apply button styles to a custom element instead of a <button>

…propsButtonHTMLAttributesAll native button attributes