Hulian UIv0.93.5413 components0 components
  • Start
  • Components
  • Blocks
  • Pages
  • Demos
  • Changelog
ChineseEnglish
  • ComponentsComponents
  • ThemeTheme

Collections

  • QuestionCard
  • Table
  • Book3D
  • ProTable
  • PricingTable
  • JsonViewer
  • EditableTable
  • List
  • Descriptions
  • RowActions
  • Tree
  • Card
  • Carousel
  • Video
  • Audio
  • BentoGrid
  • Image
  • MagicCard
  • AnimatedList
  • Marquee
  • Sortable
  • Kanban
  • DesignCanvas
  • LayerTree
  • StageDraw
  • SlideDeck
  • PresenterView
  • ComponentPicker
  • EventStream
  • QueueLane
  • DocumentSheet
  • Novel reader
  • Scheduler
  • Org classroom
  • Danmaku
  • LiveChat
  • LivePlayer
  • LogViewer
  • FileTree
  • CodeReviewThread
  • VirtualList
  • InfiniteScroll
  • LogoLoop
  • BounceCards
  • CardSwap
  • ChromaGrid
  • CircularGallery
  • DomeGallery
  • FlyingPosters
  • InfiniteMenu
  • MagicBento
  • ScrollStack
  • ProfileCard
  • TiltedCard
  • PixelCard
  • DecayCard
  • ReflectiveCard
  • Folder

Charts and Diagrams

  • Flow
  • Diagram
  • Paper
  • SequenceDiagram
  • Sankey
  • Sparkline
  • Funnel
  • Treemap
  • Gantt
  • Heatmap
  • ContributionGraph
  • Legend
  • Chart
  • WorldMap

Information

  • ImageViewer
  • LiveProductCard
  • DiffStat
  • ScoreRing
  • ScoreScale
  • Badge
  • Dot
  • StatusDot
  • Chip
  • FilterChip
  • Coupon
  • Tag
  • Annotation
  • Avatar
  • AvatarCircles
  • User
  • QRCode
  • Comment
  • RelativeTime
  • GitCommit
  • DeployStatus
  • ShieldBadge
  • AwardBadge
  • CreditCard
  • IconTile

Metrics

  • Stat
  • Statistic
  • Meter
  • Timeline
  • NumberTicker

Placeholders

  • Empty
  • Skeleton
  • Watermark

Scheduler

scheduler

Manages events across month, week, day, and resource views with drag-based editing.

Usage

Controlled usage

events / view / date are all controlled, state is held by consumers; onEventsChange gives back the entire set of new events (according to Kanban controlled paradigm).

Jun 1 – Jun 7
MonJun 1
TueJun 2
WedJun 3
ThuJun 4
FriJun 5
SatJun 6
SunJun 7
09:00
10:00
11:00
12:00
13:00
14:00
15:00
16:00
17:00
18:00
19:00
20:00
Follow-up consultation · Mr. Chen
First consultation · Ms. Liu
09:00–10:00 · Surgery
Dressing change · Mr. Zhao
Pediatric Vaccine
Postoperative follow-up
11:00–12:00
Clinic suspension · Academic conference
13:00–17:00
tsx
const [events, setEvents] = useState(INITIAL);
const [view, setView] = useState<SchedulerView>("week");
const [date, setDate] = useState(monday);

<Scheduler
  events={events}
  view={view}
  date={date}
  resources={resources}
  onViewChange={setView}
  onDateChange={setDate}
  onEventsChange={setEvents}
/>

Resource View

When view='resource', the horizontal axis is resources (doctor/clinic) and the vertical axis is time; resources needs to be passed.

June 1, 2026
Dr. LiInternal Medicine
Dr. WangSurgery
Dr. ZhangPediatrics
09:00
10:00
11:00
12:00
13:00
14:00
15:00
16:00
17:00
18:00
19:00
20:00
Follow-up consultation · Mr. Chen
Dressing change · Mr. Zhao
First consultation · Ms. Liu
09:00–10:00 · Surgery
tsx
<Scheduler
  events={events}
  view="resource"
  date={date}
  resources={resources}
  onEventsChange={setEvents}
/>

Monthly Overview

view='month' gives an overview of the whole month, click on a certain day onDateChange + onViewChange to drill down to the day view.

June 2026
Mon
Tue
Wed
Thu
Fri
Sat
Sun
tsx
<Scheduler
  events={events}
  view="month"
  date={date}
  onDateChange={setDate}
  onViewChange={setView}
/>

Custom time range

dayStartHour / dayEndHour narrows the timeline, hourHeight adjusts the pixel height per hour.

June 1, 2026
Jun 1Mon
10:00
11:00
12:00
13:00
Follow-up consultation · Mr. Chen
First consultation · Ms. Liu
09:00–10:00 · Surgery
Dressing change · Mr. Zhao
tsx
<Scheduler
  events={events}
  view="day"
  date={date}
  dayStartHour={9}
  dayEndHour={13}
  hourHeight={72}
/>

When to use

Use Scheduler for appointments, clinic rosters, or resource timelines where users create slots, move events, and resize duration. Use Gantt for a read-only project schedule or Calendar/DatePicker for date selection.

Import

ts
import { Scheduler, dateOf, dayColumns, eventRect, hourLines, layoutColumns, minutesOfDay, minutesToISO, monthMatrix, resourceColumns, snap, startOfWeekISO, weekColumns, yToMinutes } from "@hulianui/ui"

Props

NameTypeDefaultDescription
events*SchedulerEvent[]-Controlled {id, title, start, end, resourceId?, tone?, subtitle?} events using local ISO datetimes.
view*"month" | "week" | "day" | "resource"-Controlled view.
date*string-Controlled ISO focus date.
nowstring | DateBrowser clock, read after mountReference point for "today" and the current-time line. The component never reads the system clock during render, so the first frame has no today highlight and no current-time line; both appear after mount. Passing a value takes over completely, which is what makes screenshot regressions reproducible and lets "today" follow a server business clock instead of the user's machine.
resourcesSchedulerResource[]-Required in resource view: {id, title, subtitle?}.
dayStartHournumber8Timeline start hour.
dayEndHournumber20Timeline end hour.
slotMinutesnumber30Drag and create snap interval in minutes.
hourHeightnumber56Pixels per hour.
toolbarbooleantrueShows title, previous/today/next controls, and view selector.
classNamestring-Root class; establish a definite height for scrolling.

SchedulerEvent.tone is "primary" | "success" | "warning" | "danger" | "neutral", defaulting to primary.

Events

EventTypeDescription
onViewChange(v: SchedulerView) => voidView selection.
onDateChange(iso: string) => voidFocus-date change from navigation or month-day selection.
onEventsChange(events: SchedulerEvent[]) => voidReturns the complete array after move or resize.
onSlotDragCreate(slot: SchedulerSlot) => voidReports a dragged blank time range.
onSlotClick(slot: SchedulerSlot) => voidReports a clicked blank slot.
onEventClick(event: SchedulerEvent) => voidReports an event click.

Slots

SlotTypeDescription
renderEvent(event: SchedulerEvent) => ReactNodeCustom event content while Scheduler owns geometry and drag handles.

Example

tsx
const [events, setEvents] = useState<SchedulerEvent[]>(INITIAL);
const [view, setView] = useState<SchedulerView>("week");
const [date, setDate] = useState("2026-06-15");

<div className="h-[520px] w-full">
  <Scheduler
    className="h-full"
    events={events}
    view={view}
    date={date}
    resources={resources}
    onViewChange={setView}
    onDateChange={setDate}
    onEventsChange={setEvents}
    onSlotDragCreate={(slot) =>
      setEvents((prev) => [
        ...prev,
        { id: `n-${slot.start}`, title: "New appointment", start: slot.start, end: slot.end, resourceId: slot.resourceId ?? "d1", tone: "primary" },
      ])
    }
  />
</div>

Usage notes

  • The clock is never read during render. Under SSR or static export the server render happens at build time and the first client render happens at visit time; once they cross a day boundary they compute a different "today" and hydration fails (React #418). The component therefore defers "now" to after mount, so the first frame has no today highlight and no current-time line. When copying the examples, do not move dayjs() back to module scope or into the render body. useMemo(fn, []) does not help, because it only stabilizes a single render tree. Pass now when you need determinism.
  • Events, view, and date are fully controlled. Write onEventsChange back to state or dragged changes snap back.
  • The host needs a definite height so the time grid can fill it and scroll internally.
  • Tone accepts only five semantic values; use renderEvent for arbitrary color.
  • Start and end are local ISO datetimes with time, unlike Gantt's inclusive date-only values.
  • Toolbar actions, view names, weekdays, formatted titles, and the overflow label read ConfigProvider's locale.components.scheduler. zhCN and enUS include the dictionary; legacy custom locales that omit this optional field retain the Chinese fallback.

Related

Table · Book3D · ProTable · PricingTable · JsonViewer · EditableTable

PreviousGanttData DisplayNextOrg classroom

On this page

  • Usage
  • Documentation
    • When to use
    • Import
    • Props
    • Events
    • Slots
    • Example
    • Usage notes
    • Related