QuickActions
BasicLayout
<co-quick-actions>QuickActions is the 3-column grid of big icon tiles on phone and portal home screens.
import { QuickActions } from 'health-components';
Examples
Links
Usage
<QuickActions items={[{ label: "Book Visit", icon: "calendar" }, { label: "Messages", icon: "message", badge: 2 }]} />
When to use
- Phone and portal home.
When not to use
- Desktop: buttons in the page header.
Variants and states
| Variant | What it is |
|---|---|
| badge | Count on a tile. |
Accessibility
- Links with text labels, 44px tall.
Do and don't
- Do: Six tiles at most.
- Don't: Icons without labels.
Props
| Prop | Type | Default | Description |
|---|---|---|---|
items * | QuickActionItem[] | — | Array<{label, icon, href?, badge?, onClick?}> |
Also accepts native attributes, including defaultChecked, defaultValue, autoFocus, plus className and event handlers on the root element.
Angular, Vue and HTML
Register the elements once (Angular guide), then use <co-quick-actions>. 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-quick-actions default-checked auto-focus [items]="items"></co-quick-actions>
| Kind | Name | Description |
|---|---|---|
| property / JSON attribute | items | Array<{label, icon, href?, badge?, onClick?}> |
| attribute | default-checked / defaultChecked | |
| property / JSON attribute | default-value / defaultValue | |
| attribute | auto-focus / autoFocus |