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
Sizes
States
As Link
Full Width
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
primaryonce per area for the main action; everything else issecondary. - Use
aionly 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
dangerwith a destructive Modal.
Variants and states
| Variant | What it is |
|---|---|
| primary | Main action. One per card, modal footer or page header. |
| secondary | Default. Every other action. Shows is-on when it toggles a view (pressed). |
| tertiary / ghost | Low-weight actions in dense toolbars and table rows. |
| danger | Outlined red: Delete, Void Claim, Remove Allergy. The solid red (danger-solid) is only for the confirm button inside a destructive Modal. |
| link | Inline text action, 13px: View history, Clear selection. |
| ai | Purple fill for AI actions. |
| sizes | sm 30px (tables, toolbars, Compact density), md 36px, lg 48px (kiosk and patient portal). |
| states | hover, 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-ringwith 2px offset.
Do and don't
- Do: "Save Claim" as primary and "Cancel" as secondary in a claim modal footer.
- Do: Show
loadingwhile 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
| Prop | Type | Default | Description |
|---|---|---|---|
variant | ButtonVariant | 'secondary' | Visual weight. Use `primary` once per area; `ai` only for actions that run an AI model. |
size | ButtonSize | 'md' | 'sm' 30px (tables, toolbars), 'md' 36px, 'lg' 48px (kiosk, portal) |
loading | boolean | false | Shows a spinner, keeps the label, disables the button and sets aria-busy |
iconLeft | IconName | none | Icon before the label |
iconRight | IconName | none | Icon after the label |
full | boolean | false | Full width (phone screens) |
pressed | boolean | undefined (not a toggle) | Toggle state; sets aria-pressed |
href | string | — | Renders an `<a>` with button styling |
target | AnchorHTMLAttributes<HTMLAnchorElement>['target'] | — | Link target when `href` is set |
rel | string | — | Link rel when `href` is set |
children | ReactNode | — | 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>
| Kind | Name | Description |
|---|---|---|
| attribute | variant | Visual weight. Use `primary` once per area; `ai` only for actions that run an AI model. Default 'secondary' |
| attribute | size | 'sm' 30px (tables, toolbars), 'md' 36px, 'lg' 48px (kiosk, portal); default 'md' |
| attribute | loading | Shows a spinner, keeps the label, disables the button and sets aria-busy; default false |
| attribute | icon-left / iconLeft | Icon before the label; default none |
| attribute | icon-right / iconRight | Icon after the label; default none |
| attribute | full | Full width (phone screens); default false |
| attribute | pressed | Toggle state; sets aria-pressed; default undefined (not a toggle) |
| attribute | href | Renders an `<a>` with button styling |
| property / JSON attribute | target | Link target when `href` is set |
| attribute | rel | Link rel when `href` is set |
| attribute | default-checked / defaultChecked | |
| property / JSON attribute | default-value / defaultValue | |
| attribute | auto-focus / autoFocus | |
| attribute | type | |
| attribute | disabled | |
| attribute | name | |
| property / JSON attribute | value | |
| slot | (default) | Label text: a verb in Title Case that says what happens ("Submit Claim"). |