Week Agenda View
Data Display
Navigation
Week overview with day selector and event details for scheduling.
Preview
Week overview with day selector and event details
This Week
Nov 25 - Dec 1
Team Standup
09:00 - 09:30Zoom
3
Product Review
10:30 - 11:30Conference Room A
5
Focus Time
12:00 - 14:00
Client Call
14:30 - 15:15Phone
2
With Custom Data
Customize days, events, and handle user interactions
This Week
Dec 25 - Dec 31
Team Standup
09:00 - 09:30Zoom
3
Product Review
10:30 - 11:30Conference Room A
5
Focus Time
12:00 - 14:00
Client Call
14:30 - 15:15Phone
2
Props
Component API reference
WeekAgendaView
| Prop | Type | Default | Description |
|---|---|---|---|
days | DayConfig[] | Default days | Days configuration |
events | AgendaEvent[] | Default events | Events for selected day |
weekLabel | string | "Nov 25 - Dec 1" | Week label text |
title | string | "This Week" | Header title |
defaultSelectedDay | number | 4 | Initial selected day index |
onDaySelect | (dayIndex: number, day: DayConfig) => void | — | Callback when day is selected |
onWeekChange | (direction: 'prev' | 'next') => void | — | Callback when navigating weeks |
onEventClick | (event: AgendaEvent) => void | — | Callback when event is clicked |
className | string | — | Additional CSS classes |
DayConfig
| Prop | Type | Default | Description |
|---|---|---|---|
day* | string | — | Day abbreviation (Mon, Tue, etc.) |
date* | number | — | Day of month |
events* | number | — | Number of events |
hasImportant | boolean | — | Has important events |
isToday | boolean | — | Whether this is today |
AgendaEvent
| Prop | Type | Default | Description |
|---|---|---|---|
id* | string | number | — | Unique identifier |
title* | string | — | Event title |
time* | string | — | Time range (e.g., "09:00 - 09:30") |
type* | 'meeting' | 'call' | 'focus' | — | Event type |
location | string | — | Event location |
attendees | number | — | Number of attendees |
Usage
Import and implementation examples
import { WeekAgendaView, type AgendaEvent, type DayConfig } from '@/blocks/calendar/week-agenda-view'
// Basic usage with defaults
<WeekAgendaView />
// With custom days and events
const days: DayConfig[] = [
{ day: 'Mon', date: 25, events: 3, hasImportant: false },
{ day: 'Tue', date: 26, events: 2, hasImportant: false },
{ day: 'Wed', date: 27, events: 5, hasImportant: true },
{ day: 'Thu', date: 28, events: 1, hasImportant: false },
{ day: 'Fri', date: 29, events: 4, isToday: true },
{ day: 'Sat', date: 30, events: 0 },
{ day: 'Sun', date: 1, events: 1 }
]
const events: AgendaEvent[] = [
{
id: 1,
title: 'Team Standup',
time: '09:00 - 09:30',
type: 'meeting',
location: 'Zoom',
attendees: 3
},
{
id: 2,
title: 'Focus Time',
time: '12:00 - 14:00',
type: 'focus'
}
]
<WeekAgendaView
days={days}
events={events}
weekLabel="Nov 25 - Dec 1"
title="This Week"
defaultSelectedDay={4}
onDaySelect={(dayIndex, day) => {
console.log('Day selected:', day)
loadEventsForDay(dayIndex)
}}
onWeekChange={(direction) => {
if (direction === 'next') loadNextWeek()
else loadPreviousWeek()
}}
onEventClick={(event) => openEventModal(event)}
/>Features
Built-in functionality
- 7-day week selector: Day selector with dates and event counts
- Event count indicators: Up to 4 dots per day showing event count
- Important event badges: Red dot indicator for important events
- Week navigation: Previous/next week controls
- Selected day highlighting: Indigo background for selected day
- Today indicator: Subtle background for current day
- Color-coded events: Meeting, call, and focus types with colors
- Event details: Time, location, and attendee count
- Interactive events: Hover states and click handlers
- Dark mode: Full dark mode support
Accessibility
Accessibility considerations
ARIA Attributes
role="tablist" for day selectoraria-selected for selected dayaria-label for navigation buttonsKeyboard Navigation
| Key | Action |
|---|---|
| Arrow keys | Navigate between days |
| Enter | Select day or event |
| Tab | Navigate between sections |
Notes
- Screen readers announce day and event information
- Event counts are announced for each day
- Focus indicators on all interactive elements