WeekView
Standalone schedule week view component
Source
LLM docs
Docs
Package
Usage
WeekView displays events for an entire week with time slots. It supports all-day events, overlapping events, drag and drop, custom time ranges, and more.
Time range
Use startTime and endTime props to set the visible time range. Times should be in HH:mm:ss format.
Interval minutes
intervalMinutes prop controls the granularity of time slots. Default is 60 minutes.
First day of week
Set firstDayOfWeek to control which day starts the week. 0 is Sunday, 1 is Monday (default), etc.
Weekday format
Use weekdayFormat prop to customize the weekday names display. It accepts dayjs format strings.
Without weekend days
Set withWeekendDays={false} to hide Saturday and Sunday columns.
Highlight today
Set highlightToday to visually distinguish today's column:
Without week number
Set withWeekNumber={false} to hide the week number in the top-left corner.
Current time indicator
Set withCurrentTimeIndicator to display a line showing the current time on today's column.
Without all-day slots
Set withAllDaySlots={false} to hide the all-day events section at the top.
Without header
Set withHeader={false} to hide the header controls.
Week label format
Use weekLabelFormat prop to customize the week range display in the header.
Slot label format
slotLabelFormat prop controls the format of time labels.
Slot height
Customize the height of time slots and the all-day section using slotHeight and
allDaySlotHeight props.
Business hours
Use highlightBusinessHours and businessHours props to visually distinguish business hours.
Overlapping events
When multiple events overlap in time, they are automatically positioned side by side.
Drag and drop
Enable drag and drop by setting withDragDrop prop. Events can be dragged to different days and times.
Full event customization
Use renderEvent prop to fully customize event rendering. This function receives the event
data as the first argument and all props that would be passed to the event root element
(including children) as the second argument, allowing you to wrap events in custom components
like HoverCard, Tooltip, or custom wrappers.
Static mode
Set mode="static" to disable all interactions.
Create and update events
Set withDragSlotSelect prop to allow users to drag across time slots to select a time range.
When the drag ends, the onSlotDragEnd callback is called with the range start and end dates.
The drag is constrained to a single day column. Combined with onTimeSlotClick, onAllDaySlotClick,
and onEventClick callbacks, this enables a complete event creation and editing experience.
Accessibility
Focus management
In the WeekView component, focus is managed to provide an efficient keyboard navigation experience:
- The weekdays row, all-day slots row, and time slots grid each have their first element in the tab order (
tabIndex={0}) - All other elements have
tabIndex={-1}and can only be reached via arrow key navigation - This approach reduces the number of tab stops when navigating through the schedule
Keyboard interactions
Weekdays row:
All-day slots (when enabled):
Time slots:
Slot labels
Each time slot button has an aria-label attribute with the complete slot information including the date and time range (e.g., "Time slot 2025-11-03 08:00:00 - 09:00:00"). All-day slots have labels like "All day 2025-11-03", and weekday buttons have labels like "Weekday 2025-11-03". This provides screen reader users with complete context about each element.