Back to components

Button

zyra-button

Token-aware action buttons for primary flows, secondary actions, and compact utility triggers.

Component preview

Explore the available states and the real library behavior for this component.

zyra-button Playground

VariantsSizesStates

Interactive button component with loading states, icons, and multiple variants

Controls
variant
size
loading
disabled
fullWidth
label
iconLeft
iconRight
Live Preview
Generated Code
<zyra-button variant="primary" size="md">
  Button
</zyra-button>

Copy-paste example

Drop this into your Angular standalone component and it works out of the box.

button.demo.ts
import { Component } from '@angular/core';
import { ZyraButton } from 'zyra-ng-ui';

@Component({
  selector: 'app-demo-button',
  standalone: true,
  imports: [ZyraButton],
  template: `
    <zyra-button variant="primary" size="md">
      Save changes
    </zyra-button>
  `,
})
export class DemoButtonComponent {}

Variants

All the visual modes and states available for this component.

primary

High-emphasis CTA - use once per section

secondary

Medium-emphasis supporting action

outline

Bordered variant for neutral actions

ghost

Text-only for low-emphasis or toolbar actions

danger

Destructive or irreversible actions

API

All inputs and configuration options for zyra-button.

PropTypeDefaultDescription
variant'primary' | 'secondary' | 'outline' | 'ghost' | 'danger''primary'Visual style
size'sm' | 'md' | 'lg''md'Height and padding scale
disabledbooleanfalsePrevents interaction; adds muted styling
loadingbooleanfalseShows spinner; blocks double-submit
leftIconIconDefinition-Icon rendered before the label
rightIconIconDefinition-Icon rendered after the label

Accessibility

Built to meet WCAG 2.0 AA. These notes cover the key ARIA, keyboard, and interaction behaviours.

  • Renders as a native <button> - keyboard accessible via Tab, Enter, and Space
  • loading state sets aria-busy="true" to communicate pending status to screen readers
  • disabled state communicates unavailability without removing focusability
  • All variants maintain a visible 2px focus ring for keyboard navigation