hydroxy

Week scheduler

Events on a time grid in day, work-week or week view. Drag on empty time to create an event, drag one to move it across times and days, or drag its bottom edge to resize it, all snapping to 15 minutes. Overlapping events sit side by side. Everything works from the keyboard too.

2 – 8 November 2026
GMT
Mon2
Tue3
Wed4
Thu5
Fri6
Sat7
Sun8
All day
Q1 planning week
Team offsite
Release freeze
Sprint planning10:00 to 11:30
1:1 with Priya14:00 to 14:45
Design review: checkout11:00 to 12:30
Customer call: Northwind11:30 to 12:00
Interview: frontend engineer15:00 to 16:00
Lunch and learn: accessibility12:30 to 13:30
Pairing with Sam13:00 to 14:30
Vendor demo13:30 to 14:00
Sprint retro16:00 to 17:00
Standup09:30 to 09:45
Standup09:30 to 09:45
Standup09:30 to 09:45
Standup09:30 to 09:45
Standup09:30 to 09:45
09:00 to 10:00

Arrow Up and Down move the event by the snap step, Left and Right by a day. Shift with Up or Down changes when it ends. Enter selects it.

Arrow keys move the slot, Up and Down by the snap step, Left and Right by a day. Shift with Up or Down changes its length. Page Up and Page Down move an hour. Enter creates an event.

Drag on empty time to add an event, or drag one to move it.

Usage

use hydroxy_leptos::week_scheduler::*;
use leptos::prelude::*;

fn d(day: u8) -> Date {
    Date::new(2026, 11, day).expect("a real date")
}

fn at(h: u16, m: u16) -> u16 {
    h * 60 + m
}

fn week() -> Vec<WeekEvent> {
    let mut events = vec![
        WeekEvent::all_day("planning-week", "Q1 planning week", d(2)).with_tone(EventTone::Info),
        WeekEvent::timed("sprint", "Sprint planning", d(2), at(10, 0), at(11, 30)).with_tone(EventTone::Info),
        WeekEvent::timed("one-to-one", "1:1 with Priya", d(2), at(14, 0), at(14, 45)),
        WeekEvent::timed("design-review", "Design review: checkout", d(3), at(11, 0), at(12, 30)),
        WeekEvent::timed("northwind", "Customer call: Northwind", d(3), at(11, 30), at(12, 0)).with_tone(EventTone::Warning),
        WeekEvent::timed("interview", "Interview: frontend engineer", d(3), at(15, 0), at(16, 0)).with_tone(EventTone::Success),
        WeekEvent::timed("lunch-learn", "Lunch and learn: accessibility", d(4), at(12, 30), at(13, 30))
            .with_tone(EventTone::Success),
        WeekEvent::timed("pairing", "Pairing with Sam", d(4), at(13, 0), at(14, 30)),
        WeekEvent::timed("vendor", "Vendor demo", d(4), at(13, 30), at(14, 0)).with_tone(EventTone::Warning),
        WeekEvent::all_day("offsite", "Team offsite", d(5)),
        WeekEvent::all_day("freeze", "Release freeze", d(6)).with_tone(EventTone::Danger),
        WeekEvent::timed("retro", "Sprint retro", d(6), at(16, 0), at(17, 0)).with_tone(EventTone::Info),
    ];
    for day in 2..=6 {
        events.push(WeekEvent::timed(format!("standup-{day}"), "Standup", d(day), at(9, 30), at(9, 45)));
    }
    events
}

pub fn demo() -> AnyView {
    // Controlled: the owner holds the events. Today and now are fixed so the page is the same every day.
    let (events, set_events) = signal(week());
    let (last, set_last) = signal(String::from("Drag on empty time to add an event, or drag one to move it."));
    let next = StoredValue::new(1_u32);

    view! {
        <div style="display: grid; gap: var(--space-3);">
            <WeekScheduler
                label="Product team calendar"
                events=events
                today=d(3)
                timezone="GMT"
                now=at(14, 25)
                on_create=move |p: Placement| {
                    let n = next.get_value();
                    next.set_value(n + 1);
                    let id = format!("new-{n}");
                    let event = if p.all_day {
                        WeekEvent::all_day(id, "New event", p.date)
                    } else {
                        WeekEvent::timed(id, "New event", p.date, p.start, p.end)
                    };
                    set_last.set(format!("Added: {}", placement_text(p)));
                    set_events.update(|list| list.push(event));
                }
                on_change=move |e: WeekEvent| {
                    set_last.set(format!("Moved: {}", event_label(&e)));
                    set_events.update(|list| apply_change(list, &e));
                }
                on_select=move |id: String| {
                    let picked = events.with_untracked(|list| list.iter().find(|e| e.id == id).map(event_label));
                    if let Some(text) = picked {
                        set_last.set(format!("Selected: {text}"));
                    }
                }
            />
            <p style="margin: 0; font: var(--text-xs); color: var(--text-3);">{last}</p>
        </div>
    }
    .into_any()
}

Anatomy

Componentdata-partRenders
WeekSchedulerrootrole=region. data-view=day|work-week|week, data-dragging=create|move|resize during a drag
(inside)toolbar, nav, prev, today, nextPrevious, Today and Next. The arrows are named "Previous week" or "Next day"
(inside)titleThe visible range, such as "2 – 8 November 2026"
(inside)viewsrole=group of Day, Work week and Week buttons, aria-pressed
(inside)header, zone, day, weekday, dateThe time zone in the corner, then one heading per day. data-today on today
(inside)allday, allday-days, allday-cell, allday-eventThe all-day row. Click an empty cell to add an all-day event
(inside)scroller, body, gutter, hourThe scrolling grid and its hour labels. Opens at scroll_to_hour
(inside)days, columnThe days layer that takes pointer drags, and one column per day (data-today, data-weekend)
(inside)event, event-title, event-time, handle<div role=button>. data-tone, data-selected, data-dragging, data-short. The handle is the bottom edge
(inside)ghostThe new event being drawn
(inside)nowThe line across today at the now minute
(inside)slot<div role=button> that walks the grid with the keyboard; visible only with keyboard focus
(inside)instructions, liveVisually hidden help (aria-describedby) and a polite status region

Keyboard

KeyDoes
TabMove between the toolbar, all-day events, events and the slot
Arrow Up / Down on an eventMove it 15 minutes earlier or later
Arrow Left / Right on an eventMove it a day, within the visible days
Shift + Arrow Up / Down on an eventChange when it ends
Enter / Space on an eventSelect it
Arrow keys on the slotMove the slot; Shift with Up or Down changes its length
Page Up / Page Down on the slotMove the slot an hour
Enter / Space on the slotCreate an event there
EscapeCancel a drag
Pointer dragCreate, move or resize. A click on empty time makes a one-hour event. Touch scrolls the grid; drag events directly

Props

PropTypeNotes
labelStringRequired. Accessible name for the region
eventsVec<WeekEvent>Required. The owner's events. WeekEvent::timed(id, title, date, start, end) or WeekEvent::all_day(id, title, date), .with_tone(..)
todayDateRequired. The Today button's target and the highlighted column
timezoneStringRequired. Shown in the corner, such as "GMT"
default_dateOption<Date>The date shown first. Default today
default_viewWeekViewDay, WorkWeek or Week. Default Week
week_startu80 = Sunday. Default 1, Monday
snapu16Minutes drags and arrow keys snap to. Default 15
default_durationu16Minutes for an event made by a click or Enter. Default 60
nowOption<u16>Minutes after midnight for the now line. The component reads no clock
scroll_to_houru8Hour at the top when it opens. Default 8
heightu32Height of the scrolling grid in px. Default 560
disabledboolBlock creating, moving and resizing
on_createCallback<Placement>A new event was drawn: date, start, end, all_day
on_changeCallback<WeekEvent>An event moved or was resized. Store it with apply_change
on_selectCallback<String>An event was clicked or Enter was pressed on it
on_range_changeCallback<(Date, Date)>The visible days changed, first to last
Actions
Button
Icon button
Toolbar
Theme menu
Display
Avatar
Badge
Card
Chip
Code block
Markdown
Doc card
Due pill
Kbd
Priority mark
Source chip
Space icon
Status diamond
Tag
Value diff
Carousel
Reveal
Media timeline
QR code
Transcript viewer
Audio waveform
Audio player
Forms
Calendar
Checkbox
Combobox
Date picker
Color picker
Cron builder
Theme editor
Mention input
Signature pad
Image cropper
Date field
Date range picker
Duration field
Quantity stepper
Filter chip
Input
Markdown editor
Radio group
Search field
Segmented control
Select
Slider
Range slider
Rating
Toggle button
File dropzone
Upload queue
Attachment
Switch
Tags input
Number field
Money field
Phone field
Time field
OTP input
Password field
Questionnaire
Availability picker
Voice input
Recording control
Inline edit
Async validated input
Shortcut recorder
Data
Spreadsheet grid
Week scheduler
Virtual list
Stat card
Step track
Kanban board
Sortable list
Filter builder
Data table
Grid
Access editor
File manager
Gantt chart
Log stream
Diff viewer
JSON inspector
Terminal
Node editor
Whiteboard
Navigation
Table of contents
Breadcrumb
Tabs
Wizard
Nav item
Nav section
Tree view
Pagination
Menubar
Navigation menu
Saved views
Layout
Master detail
App shell
Sidebar layout
Resizable panels
Dashboard layout
Dock layout
Feedback
Callout
Check list
Empty state
Progress bar
Toast
Approval card
Skeleton
Notification center
Bars
Bar chart
Diverging bar chart
Span chart
Pictogram chart
Stacked bar chart
Funnel chart
Bullet chart
Waffle chart
Marimekko chart
Dot plot chart
Error bar chart
Pareto chart
Waterfall chart
Lollipop chart
Grouped bar chart
Bar race chart
KPIs and frames
Chart frame
Metric card
Sparkline
Points
Scatter chart
Smith chart
Strip plot
Beeswarm chart
Parallel coordinates
Ternary chart
Bland-Altman chart
Quiver chart
Connected scatter chart
Grids and tables
Heatmap chart
Chart table
Cohort chart
Radial
Radial charts
Radar chart
Polar area chart
Stat ring
Clock chart
Spiral chart
Lines and areas
Bump chart
Slope chart
Line chart
Composed chart
Small multiples
Cycle plot chart
Horizon chart
Stacked area chart
Threshold chart
Split line chart
Linked charts
Confidence band chart
Forecast fan chart
Step chart
Range area chart
Distributions
Contour chart
Histogram
Box plot
Density chart
Ridgeline chart
Violin chart
Q-Q chart
Survival chart
ECDF chart
Raincloud plot
Forest plot
Maps
Geo map
Bubble map
Hexbin map
Cartogram
Flow map
Parts of a whole
Donut chart
Voronoi treemap
Nested donut chart
Treemap chart
Sunburst chart
Bubble pack chart
Icicle chart
Flame graph chart
Pie chart
Word cloud
Relationships
Sankey chart
Network chart
Chord chart
UpSet chart
Venn chart
Alluvial chart
Adjacency matrix chart
Dependency graph chart
Tree chart
Arc diagram
Hive plot
Edge bundling
Finance
Candlestick chart
OHLC chart
Depth chart
Renko chart
Time
Timeline chart
Calendar heatmap chart
Spectrogram chart
Marey chart
Overlays
Tour
Lightbox
Alert dialog
Command palette
Dialog
Menu
Popover
Tooltip
Sheet
Hover card
Context menu
Utilities
Pacer
Hotkeys
Disclosure
Accordion
Collapsible
Chat
Chat bubble
Voice session
Composer
Thread
Thread list
Assistant composer
Assistant MCP
Assistant modal
Assistant thread
Assistant thread list
Message scroller
Insight note
Emoji picker
Tool trace
Model picker
Citation popover
Activity
Activity feed
Comment thread
Timeline
Presence bar
Live cursors
Reaction bar
Guides
Getting started
All components
All charts