InboxItem
ComplexWork queues
<co-inbox-item>InboxItem is one inbox card for a result, refill, message, co-sign, imaging or fax, with priority and inline actions.
import { InboxItem } from 'health-components';
Examples
Inbox
Kinds
Usage
<InboxItem item={{ kind: "refill", patient: "Henna West", title: "Metformin 500 mg", from: "Walgreens", received: "9:02 AM", actions: ["Approve", "Deny"] }} />
When to use
- Inbox cards on phones and dashboards.
When not to use
- Bulk work: InboxList table.
Variants and states
| Variant | What it is |
|---|---|
| kinds | result, refill, message, cosign, imaging, fax. |
| unread | Bold with primary edge. |
| critical | Red card. |
Accessibility
- Priority in words.
Do and don't
- Do: First action is the likely one.
- Don't: More than 3 actions.
Props
| Prop | Type | Default | Description |
|---|---|---|---|
item * | InboxItemData | — | {kind, patient, title, from, received, priority?, unread?, actions?: string[]}; required |
onAction | (action: string, item: InboxItemData) => void | none | Called with the action label when an action button is pressed |
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-inbox-item>. 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-inbox-item default-checked auto-focus [item]="item" (co-action)="onAction($event.detail)"></co-inbox-item>
| Kind | Name | Description |
|---|---|---|
| property / JSON attribute | item | {kind, patient, title, from, received, priority?, unread?, actions?: string[]}; required |
| attribute | default-checked / defaultChecked | |
| property / JSON attribute | default-value / defaultValue | |
| attribute | auto-focus / autoFocus | |
| event | co-action | Called with the action label when an action button is pressed; default none (React: onAction) |