TaskCard
ComplexWork queues
<co-task-card>TaskCard is one staff task with done check, patient, due date, overdue tag, category and owner.
import { TaskCard } from 'health-components';
Examples
Board
Overdue
Done
Usage
<TaskCard task={{ title: "Call back about MRI auth", patient: "Ralph Edwards", due: "Today 3 PM", owner: "Sam Patel", tag: "Prior Auth" }} />
When to use
- Task boards and home dashboards.
When not to use
- Clinical results: InboxItem.
Variants and states
| Variant | What it is |
|---|---|
| open / done | Checkbox. |
| overdue | Red border and tag. |
Accessibility
- Checkbox named after the task.
Do and don't
- Do: Name the owner.
- Don't: Unowned tasks.
Props
| Prop | Type | Default | Description |
|---|---|---|---|
task * | TaskCardData | — | {title, patient?, due?, overdue?, done?, tag?, owner}; required |
done | boolean | undefined (uncontrolled, starts at `task.done`) | Controlled done state |
onDoneChange | (done: boolean, task: TaskCardData) => void | — | Called when the done check changes |
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-task-card>. 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-task-card done default-checked [task]="task" (co-done-change)="onDoneChange($event.detail)"></co-task-card>
| Kind | Name | Description |
|---|---|---|
| property / JSON attribute | task | {title, patient?, due?, overdue?, done?, tag?, owner}; required |
| attribute | done | Controlled done state; default undefined (uncontrolled, starts at `task.done`) |
| attribute | default-checked / defaultChecked | |
| property / JSON attribute | default-value / defaultValue | |
| attribute | auto-focus / autoFocus | |
| event | co-done-change | Called when the done check changes (React: onDoneChange) |