terra vidhal

Medication Schedule

Component

About

A daily medication schedule grouped by time with a day timeline, animated check-offs, an adherence ring, pending and taken filters, next-dose hint, undoable mark-all, refill top-up and a compact add-medication form.

Built with React and Tailwind. Copy the prompt and paste it into Claude Code, Cursor or Lovable: your agent adds Medication Schedule to your project and fits it to your theme.

Code

How Medication Schedule is used: the demo's code. The component's own source comes with a free account.

Usage.tsx

"use client";

/**
 * PrequelUI Animate — MIT — https://prequeluianimate.terravidhal.me
 */

import { MedicationSchedule, type Medication } from "@/components/ui/medication-schedule";

const MEDICATIONS: Medication[] = [
  {
    id: "m1",
    name: "Amlodipine",
    dose: "5 mg",
    times: ["08:00"],
    instructions: "Take with water after breakfast.",
    refillLeft: 12,
    color: "#0ea5e9",
  },
  {
    id: "m2",
    name: "Metformin",
    dose: "500 mg",
    times: ["08:00", "19:00"],
    instructions: "Take with food to reduce stomach upset.",
    refillLeft: 3,
    color: "#8b5cf6",
  },
  {
    id: "m3",
    name: "Vitamin D",
    dose: "1000 IU",
    times: ["12:30"],
    instructions: "Take with the midday meal.",
    refillLeft: 26,
    color: "#f59e0b",
  },
  {
    id: "m4",
    name: "Ibuprofen",
    dose: "200 mg",
    times: ["12:30", "20:00"],
    instructions: "Only as needed for pain. Do not exceed two doses.",
    refillLeft: 8,
    color: "#10b981",
  },
  {
    id: "m5",
    name: "Magnesium",
    dose: "200 mg",
    times: ["21:30"],
    instructions: "Take before bedtime.",
    refillLeft: 2,
    color: "#f43f5e",
  },
];

const TAKEN: Record<string, boolean> = {
  "m1-08:00": true,
  "m2-08:00": true,
  "m4-20:00": false,
};

export default function MedicationScheduleDemo() {
  return (
    <main className="flex min-h-screen w-full items-start justify-center bg-gradient-to-b from-muted/40 via-background to-background px-4 py-8 sm:px-6">
      <MedicationSchedule
        dayLabel="Tuesday, 11 February"
        now="10:30"
        medications={MEDICATIONS}
        initialTaken={TAKEN}
        title="Daily medication plan"
      />
    </main>
  );
}

Dependencies

More by terra vidhal

View all
  • Project Timeline

    Project Timeline

    30
  • Kanban Board

    Kanban Board

    20
  • Gravity Stars Background

    Gravity Stars Background

    20
  • Booking Calendar

    Booking Calendar

    18
  • Notification Center

    Notification Center

    16
  • Audio Waveform

    Audio Waveform

    16
  • Kpi Counter

    Kpi Counter

    16
  • Topographic Lines

    Topographic Lines

    16

Explore more

Part of PrequelUI Animate — browse the full library on 21st.dev.