DDBS UI
dashboard

Shift Timeline

A horizontal shift timeline: a row per person, a bar for the shift, event dots and a Now line. Scrolls sideways on narrow screens.

npx shadcn@latest add https://ui.develop-better-solutions.com/r/dash-shift-timeline.json
Fullscreen
  • Checked in
  • Pending
06:0008:0010:0012:0014:0016:0018:0020:0022:00
Dr. Amal BerradaCardiologist
Dr. Youssef AlaouiNeurologist
Dr. Salma TaziPediatrician
On leave

Usage

dash-shift-timeline-example.tsx
import { DashShiftTimeline } from "@dbs/ui";
import { DashScope } from "./_store";

export default function DashShiftTimelineExample() {
  return (
    <DashScope minHeight={0}>
      <DashShiftTimeline
        now={11.7}
        legend={{ done: "Checked in", pending: "Pending" }}
        rows={[
          { id: "1", name: "Dr. Amal Berrada", subtitle: "Cardiologist", avatarSrc: "/samples/avatar-mira.jpg", start: 7, end: 15, events: [{ id: "e1", at: 9.3, label: "09:20 Follow-up", done: true }, { id: "e2", at: 12.3, label: "12:20 Review" }] },
          { id: "2", name: "Dr. Youssef Alaoui", subtitle: "Neurologist", avatarSrc: "/samples/ipsum-man.jpg", start: 9, end: 17, events: [{ id: "e3", at: 10.3, label: "10:20 Consultation", done: true }, { id: "e4", at: 14.3, label: "14:20 Follow-up" }] },
          { id: "3", name: "Dr. Salma Tazi", subtitle: "Pediatrician", start: 8, end: 16, offLabel: "On leave" },
        ]}
      />
    </DashScope>
  );
}