Partial Component

Button

The Button partial is a base UI element used throughout the component system. It provides consistent styling and behavior for call-to-action elements, supporting multiple visual styles.

Manifest

{
  "name": "button",
  "type": "_partials",
  "styles": ["button.css"],
  "scripts": [],
  "requires": []
}

Configuration

ctas:
  - url: '/contact'
    label: 'Get Started'
    isButton: true
    buttonStyle: 'primary'
  - url: '/learn-more'
    label: 'Learn More'
    isButton: true
    buttonStyle: 'secondary'
    isSmall: true

Configuration Options

PropertyTypeRequiredDefaultDescription
urlstringYes-Link destination URL
labelstringYes-Button text
isButtonbooleanNotrueRender as button vs text link
buttonStylestringNo'primary'Visual style: 'primary', 'secondary', 'tertiary'
isSmallbooleanNofalseRender as small button

Examples

Standard button sizes in all three styles:

Small buttons for compact UI elements:

Usage in Templates

{% from "components/_partials/button/button.njk" import button %}

{{ button(cta) }}

Notes

  • Primary, secondary, and tertiary visual styles
  • Standard and small button sizes
  • External Links open new window handling with proper rel attributes
  • ARIA labels and keyboard navigation support
  • Interactive visual feedback