Skip to main content

Button

BasicActions<co-button>

Button runs one action on the screen, from Save Claim to Start Visit Note.

import { Button } from 'health-components';

Examples​

Variants​

Storybook

Sizes​

Storybook

States​

Storybook
Storybook

Full Width​

Storybook

Usage​

<Button variant="primary" iconLeft="plus" onClick={startNote}>Start Visit Note</Button>
<Button variant="danger" size="sm">Void Claim</Button>
<Button variant="primary" loading={checking}>Check Coverage</Button>

When to use​

  • Commit or move a task forward: Save, Submit Claim, Start Visit Note, Check In.
  • Use primary once per area for the main action; everything else is secondary.
  • Use ai only for actions that run an AI model (Draft with AI Scribe, Suggest Codes).

When not to use​

  • Navigation to another screen inside running text: use a link.
  • Filtering a list: use FilterChip or SegmentedControl.
  • Destroying data without a confirm step: pair danger with a destructive Modal.

Variants and states​

VariantWhat it is
primaryMain action. One per card, modal footer or page header.
secondaryDefault. Every other action. Shows is-on when it toggles a view (pressed).
tertiary / ghostLow-weight actions in dense toolbars and table rows.
dangerOutlined red: Delete, Void Claim, Remove Allergy. The solid red (danger-solid) is only for the confirm button inside a destructive Modal.
linkInline text action, 13px: View history, Clear selection.
aiPurple fill for AI actions.
sizessm 30px (tables, toolbars, Compact density), md 36px, lg 48px (kiosk and patient portal).
stateshover, focus ring, disabled (45% opacity), loading (spinner, label kept, button disabled, aria-busy).

Accessibility​

  • Labels are verbs in Title Case and say what happens: "Submit Claim", not "OK".
  • Loading keeps the label so screen readers still announce it; the spinner has role status.
  • Disabled buttons are skipped by Tab. When the reason is not obvious, say it in helper text next to the button.
  • Focus ring: 2px focus-ring with 2px offset.

Do and don't​

  • Do: "Save Claim" as primary and "Cancel" as secondary in a claim modal footer.
  • Do: Show loading while an eligibility check runs, then a Toast "Coverage Checked Successfully".
  • Don't: Two primary buttons side by side ("Save" and "Submit").
  • Don't: A red button for a non-destructive action such as "Mark No Show" without a confirm.

Props​

PropTypeDefaultDescription
variantButtonVariant'secondary'Visual weight. Use `primary` once per area; `ai` only for actions that run an AI model.
sizeButtonSize'md''sm' 30px (tables, toolbars), 'md' 36px, 'lg' 48px (kiosk, portal)
loadingbooleanfalseShows a spinner, keeps the label, disables the button and sets aria-busy
iconLeftIconNamenoneIcon before the label
iconRightIconNamenoneIcon after the label
fullbooleanfalseFull width (phone screens)
pressedbooleanundefined (not a toggle)Toggle state; sets aria-pressed
hrefstring—Renders an `<a>` with button styling
targetAnchorHTMLAttributes<HTMLAnchorElement>['target']—Link target when `href` is set
relstring—Link rel when `href` is set
childrenReactNode—Label text: a verb in Title Case that says what happens ("Submit Claim").

Also accepts native attributes, including defaultChecked, defaultValue, autoFocus, type, disabled, name, value, plus className and event handlers on the root element.

Angular, Vue and HTML​

Register the elements once (Angular guide), then use <co-button>. Attributes take strings; arrays and objects are set as properties (Angular [prop], Vue :prop) or as JSON attributes. Callbacks are DOM events with the value in event.detail.

Angular template
<co-button variant="…" size="…" [target]="target">…</co-button>
KindNameDescription
attributevariantVisual weight. Use `primary` once per area; `ai` only for actions that run an AI model. Default 'secondary'
attributesize'sm' 30px (tables, toolbars), 'md' 36px, 'lg' 48px (kiosk, portal); default 'md'
attributeloadingShows a spinner, keeps the label, disables the button and sets aria-busy; default false
attributeicon-left / iconLeftIcon before the label; default none
attributeicon-right / iconRightIcon after the label; default none
attributefullFull width (phone screens); default false
attributepressedToggle state; sets aria-pressed; default undefined (not a toggle)
attributehrefRenders an `<a>` with button styling
property / JSON attributetargetLink target when `href` is set
attributerelLink rel when `href` is set
attributedefault-checked / defaultChecked
property / JSON attributedefault-value / defaultValue
attributeauto-focus / autoFocus
attributetype
attributedisabled
attributename
property / JSON attributevalue
slot(default)Label text: a verb in Title Case that says what happens ("Submit Claim").