Scheduler - Slots and Contexts

Reference for public child outlets and their Vue context values.

#Import

import { Scheduler, useSchedulerAgendaDateHeaderContext, useSchedulerEventContext, useSchedulerHeaderContext, useSchedulerResourceRowContext } from '@primeui/vue-scheduler';

#Child Outlets

Declare child outlets inside Scheduler.Content or inside a scoped view part. Scheduler passes each child the public context fields for that surface.

Outlets are declarations. They do not render where they are written. Scheduler invokes them when the active view needs that surface, then provides the correct public context for that event, cell, row, header, or overlay.

OutletSurfaceMain payload fields
Scheduler.HeaderHeader areatitle, date, view options, navigation callbacks, category controls
Scheduler.SelectionToolbarSelected-event toolbarselected ids, selected events, clear/select/invert actions
Scheduler.CategoryLegendCategory legendcategories, counts, active ids, filtering actions
Scheduler.EventGlobal event outletevent, title, timeText, view, selected and drag state
Scheduler.TimeGridEventDay, week, and working-day timed eventsevent, timeText, accentColor, drag and resize state
Scheduler.AllDayEventTime-grid all-day rowsevent, timeText, view, selected state
Scheduler.MonthEventMonth cellsevent, timeText, view, month position metadata
Scheduler.TimelineEventTimeline lanesevent, timeText, resource, view, range metadata
Scheduler.AgendaEventAgenda rowsevent, formattedTime, formattedDate, resource
Scheduler.TimeGridCellTimed grid cellsdate, time, business-hour state, blocked state, resource
Scheduler.AllDayCellAll-day row cellsdate, all-day state, selection state, resource
Scheduler.WorkCellWork cellsdate, time, business-hour state, blocked state, resource
Scheduler.TimeGutterTime labelstime, hour, minute, major tick state
Scheduler.DayHeaderDay headersdate, labels, today/weekend state
Scheduler.MonthCellNumberMonth day numberdate, label, isToday, isSelected, isDisabled
Scheduler.MonthHeaderCellMonth weekday headerdate, label, index
Scheduler.MonthCellMonth cell wrapperdate, state flags, events, view
Scheduler.MonthDayCellMonth day bodydate, day state, visible event summary
Scheduler.MonthMoreLinkMonth overflow linkdate, count, events, view
Scheduler.MiniMonthHeaderYear-view mini-month headermonth, month name, year
Scheduler.MiniMonthCellYear-view mini-month daydate, dayOfMonthLabel, hasEvents, eventCount, selection state
Scheduler.ResourceHeaderResource rail headerlabel, view, resource count
Scheduler.ResourceAreaHeaderHeader above the resource raillabel, view, resource count
Scheduler.ResourceRowTimeline resource rowresource, title, depth, isExpanded, toggle
Scheduler.ResourceGroupTimeline resource group rowresource, title, depth, isExpanded, toggle
Scheduler.ResourceAggregateBadgeResource aggregate badgeresource, aggregateCount, visible event summary
Scheduler.ResourceColumnHeaderHorizontal resource columnsresource, date, column metadata
Scheduler.TimelineCellTimeline celldate range, resource, view
Scheduler.TimelineHeaderCellTimeline header celldate range, labels, view
Scheduler.AgendaDateHeaderAgenda date groupsdate, formattedDate, dayName, eventCountText
Scheduler.MorePopoverMonth and timeline overflowdate, events, close action, overflow event drag props
Scheduler.QuickInfoQuick info overlayevent, formatted time, edit and delete actions
Scheduler.PopoverEvent details overlayevent, formatted date, formatted duration, resource
Scheduler.ContextMenuContext menu overlaytarget, event or date context, resource context

Scheduler.MorePopover also passes canDragEvent(event) and getEventDragProps(event). Bind the returned props to a custom overflow row when hidden month events should drag back into the Scheduler view.

#Scope Order

More specific scopes win over broader scopes.

Scope levelExampleUse when
Global contentScheduler.Content > Scheduler.EventOne event component covers every view that does not override it
View scopeScheduler.Month > Scheduler.MonthEventMonth needs a different card from week or timeline
Resource view scopeScheduler.ResourceTimeline > Scheduler.TimelineEventResource timeline needs resource-aware event UI
Date or resource grouped scopeScheduler.DateWeek, Scheduler.ResourceMonthGrouped columns need headers or events that differ from the ungrouped view

Place shared UI at the broadest useful level, then add scoped overrides only where the visual requirements change.

<Scheduler.Content>
    <Scheduler.Event>
        <DefaultEvent />
    </Scheduler.Event>

    <Scheduler.Month>
        <Scheduler.MonthEvent>
            <MonthEvent />
        </Scheduler.MonthEvent>
    </Scheduler.Month>

    <Scheduler.ResourceTimeline>
        <Scheduler.TimelineEvent>
            <TimelineResourceEvent />
        </Scheduler.TimelineEvent>
        <Scheduler.ResourceRow>
            <ResourceRow />
        </Scheduler.ResourceRow>
    </Scheduler.ResourceTimeline>
</Scheduler.Content>

The example above means:

  • Month uses MonthEvent.
  • Resource timeline uses TimelineResourceEvent and ResourceRow.
  • Any other event surface can fall back to DefaultEvent.

#View Scopes

ScopeApplies to
Scheduler.Monthmonth
Scheduler.Weekweek
Scheduler.Dayday
Scheduler.TimelinetimelineDay, timelineWeek, timelineMonth, timelineYear
Scheduler.Agendaagenda
Scheduler.Yearyear
Scheduler.ResourceDayresourceDay
Scheduler.ResourceWeekresourceWeek
Scheduler.ResourceMonthresourceMonth
Scheduler.ResourceTimelineresource timeline views
Scheduler.DateDaydateDay
Scheduler.DateWeekdateWeek
Scheduler.DateMonthdateMonth

#Context Hooks

Use context hooks inside a reusable child component when props are not convenient for the component shape.

HookMust be rendered insideCommon fields
useSchedulerHeaderContext()Scheduler.Headertitle, date, view, navigation callbacks, categories
useSchedulerEventContext()An event outletevent, title, timeText, surface, state flags
useSchedulerResourceRowContext()Scheduler.ResourceRowresource, title, depth, isExpanded, toggle
useSchedulerResourceGroupContext()Scheduler.ResourceGroupSame shape as resource row with group context
useSchedulerResourceAggregateBadgeContext()Scheduler.ResourceAggregateBadgeresource, aggregateCount
useSchedulerResourceColumnHeaderContext()Scheduler.ResourceColumnHeaderresource, date, column metadata
useSchedulerAgendaDateHeaderContext()Scheduler.AgendaDateHeaderdate, formattedDate, eventCountText
useSchedulerSelectionToolbarContext()Scheduler.SelectionToolbarselected ids, selected events, clear action
useSchedulerCategoryLegendContext()Scheduler.CategoryLegendcategories, counts, active category state
useSchedulerMorePopoverContext()Scheduler.MorePopoverdate, events, close action, overflow event drag props
useSchedulerQuickInfoContext()Scheduler.QuickInfoevent, formatted time, edit and delete actions
useSchedulerEventPopoverContext()Scheduler.Popoverevent, formatted date, duration, resource
useSchedulerContextMenuContext()Scheduler.ContextMenutarget, event or date context, resource context
<script setup lang="ts">
import { useSchedulerEventContext } from '@primeui/vue-scheduler';

const context = useSchedulerEventContext();
</script>

<template>
    <article :data-event-id="context.event.id">
        <strong>{{ context.title }}</strong>
        <span>{{ context.timeText }}</span>
    </article>
</template>

Context hooks return a Vue ComputedRef. Templates unwrap it automatically. In script logic, read fields through context.value.

import { computed } from 'vue';
import { useSchedulerEventContext } from '@primeui/vue-scheduler';

const context = useSchedulerEventContext();
const eventId = computed(() => context.value.event.id);

Pass { optional: true } only for shared components that can render outside their Scheduler outlet, such as isolated tests or preview shells. Normal Scheduler UI parts should fail fast when they are mounted under the wrong outlet.

#Props or Context

Both patterns are supported.

Use slot props when the custom UI is local to the page:

<Scheduler.Header v-slot="toolbar">
    <MyToolbar v-bind="toolbar" />
</Scheduler.Header>

Use context hooks when the custom UI is a reusable component:

<Scheduler.Header>
    <MyToolbar />
</Scheduler.Header>

Inside MyToolbar, call the matching context hook. This keeps the authored Scheduler tree short because the visible child component does not need a long prop list at the call site.