Getting ready together
Fictional coordination tasks. Changes stay in this example; unknown completion stays unmarked.
Confirm the preferred contact method
Lists supplied care tasks, owners, due labels, and statuses with controlled completion requests.
Fictional coordination tasks. Changes stay in this example; unknown completion stays unmarked.
Confirm the preferred contact method
Three ways in. They share one source, so the pixels match whichever you pick.
npm install @noorddev/vlak-react
// once, next to your app's root
import "@noorddev/vlak-react/css";
import { CarePlan } from "@noorddev/vlak-react";Precompiled React and one stylesheet. No compiler to configure. Per-component imports work too: @noorddev/vlak-react/components/care-plan.
npx @noorddev/vlak-cli add care-plan
The StyleX leaf lands in components/vlak/ with its dependencies, for your own compiler to own. See StyleX.
npx shadcn add https://vlak.dev/r/care-plan.json
The same registry item, installed by shadcn's CLI.
<link rel="stylesheet" href="node_modules/@noorddev/vlak/css/vlak.css" />
No React. Link vlak.css and use the markup and classes below.
import { CarePlan } from "@noorddev/vlak-react";
<CarePlan tasks={[{ id: "visit", title: "Confirm the next visit", owner: "Robin Ellis", dueLabel: "17 September", status: "Open", completed: false }]} />
// Pass onCompletedChange(taskId, completed) to request changes.
// The caller persists completion and supplies updated tasks and pending states.A supplied care task list with controlled completion requests and explicit pending states.
| Prop | Type | Default | Description |
|---|---|---|---|
tasksrequired | readonly CarePlanTask[] | ||
description | ReactNode | ||
emptyLabel | ReactNode | "No care tasks supplied" | |
onCompletedChange | (taskId: string, completed: boolean) => void | Requests a change only. Persist it and return updated tasks from the caller. |
Also accepts HTMLAttributes<HTMLDivElement>.
| Keys | Does |
|---|---|
| Tab | Moves between enabled completion checkboxes when editing is available. |
| Space | Requests a completion change through onCompletedChange. The checkbox stays at the supplied value until the caller updates it. |
<div class="rs-care-plan" role="group" aria-label="Care plan"><ul class="rs-care-plan-list"><li class="rs-care-plan-row"><p class="rs-care-plan-title">Confirm the next visit</p><dl class="rs-care-plan-metadata"><div class="rs-care-plan-field"><dt class="rs-care-plan-label">Owner</dt><dd class="rs-care-plan-value">Robin Ellis</dd></div><div class="rs-care-plan-field"><dt class="rs-care-plan-label">Due</dt><dd class="rs-care-plan-value">17 September</dd></div><div class="rs-care-plan-field"><dt class="rs-care-plan-label">Status</dt><dd class="rs-care-plan-value">Open</dd></div></dl></li></ul></div>