Schedule

A day view. Events rise into their slots, overlaps share the width, the open one grows, and a now line with a pulsing dot marks the time. Data.

Open playground

About

Schedule is a React component in the Data category of smoui. It is typed, ships no stylesheet, follows your theme through CSS variables, and honors prefers-reduced-motion. Import it with import { Schedule } from "@ashutoshswamy/smoui" and set events, from, now.

Install

Terminal
npm i @ashutoshswamy/smoui

Usage

TSX
import { Schedule } from "@ashutoshswamy/smoui";

<Schedule from={9} to={17} now="11:20" events={[{ id: "1", title: "Standup", start: "09:30", end: "10:00", where: "Room 2" }]} />

Props 3

events

24-hour times like "09:30". Overlaps sit side by side.

{ id; title; start; end; where? }[]
from / to / hour

Hours shown and pixels per hour.

numberdefault 8 / 18 / 60
now

Time for the now line. Omit for real time, "" hides it.

string