Scheduler - Data Attributes

Reference for stable data attributes and state attributes used for styling and testing.

#Import

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

#Data Attributes

Use data attributes for styling, smoke tests, and visual QA. Prefer them over descendant selectors that depend on private DOM nesting.

Runtime attributes are emitted by Scheduler itself. Attributes with a -ui suffix are emitted by installed UI parts from the PrimeOne and Tailwind layers. If a copied UI part is rewritten, keep the data-slot when tests or app styles depend on it.

#Slot Attributes

data-slot valueSurface
scheduler-rootRoot element
scheduler-headerHeader child area
scheduler-contentActive view body
scheduler-time-grid-cellDay and week time slots
scheduler-time-grid-columnDay, week, and resource time-grid columns
scheduler-all-day-rowTime-grid all-day row
scheduler-all-day-cellTime-grid all-day cells
scheduler-time-grid-eventTimed event surface
scheduler-all-day-eventAll-day event surface
scheduler-month-cellMonth grid day cell
scheduler-month-eventMonth event surface
scheduler-timeline-cellTimeline time cell
scheduler-timeline-laneTimeline lane for one resource or row
scheduler-timeline-eventTimeline event surface
scheduler-resource-areaResource timeline rail
scheduler-resource-area-headerResource rail header
scheduler-resource-listResource tree or list
scheduler-resourceResource row label
scheduler-agendaAgenda view root
scheduler-agenda-date-header-uiInstalled agenda date header UI
scheduler-agenda-eventAgenda event row
scheduler-month-header-cell-uiInstalled month header cell UI
scheduler-month-cell-number-uiInstalled month cell number UI
scheduler-more-popoverMore popover overlay
scheduler-quick-infoQuick info overlay
scheduler-event-popoverEvent popover overlay
scheduler-context-menuContext menu overlay
scheduler-selection-toolbarEvent selection toolbar
scheduler-selection-toolbar-uiInstalled selection toolbar UI
scheduler-category-legendCategory legend structural wrapper
scheduler-category-legend-uiInstalled category legend UI
scheduler-category-legend-ui-itemInstalled category legend item

#State Attributes

AttributeAppears onMeaning
data-viewRoot, header, content, event surfacesActive Scheduler view
data-shellEvent surfacesdefault or none event-shell ownership
data-selectedEvents, cells, legend itemsThe item is selected
data-focusedEvents and focusable cellsKeyboard focus is on the item
data-disabledRoot, content, cells, controlsThe item is disabled
data-draggingEvent surfacesAn event is being dragged
data-resizingEvent surfacesAn event is being resized
data-todayMonth cells, day cells, headersThe item represents today
data-weekendDate cellsThe item is a weekend day
data-other-monthMonth cell number UIThe date belongs to an adjacent month
data-resource-idResource rows, cells, events, overlaysThe surface is bound to a resource
data-event-idEvent surfacesThe surface is bound to an event
data-event-countHeaders, resource rows, legend itemsCount of events represented by the surface
data-depthResource rows and groupsResource hierarchy depth
data-dateDate cellsISO-like date key for date-targeted styling
data-timeTime-grid cellsTime slot label such as 09:30
data-start-dateTimeline cellsNumeric start timestamp for the slot
data-end-dateTimeline cellsNumeric end timestamp for the slot
data-col-indexTimeline cellsColumn index in the rendered timeline
data-drop-validDrag previewsfalse marks an invalid drop target
data-positionOverlaysCurrent overlay placement
data-selection-modeSelection toolbar UICurrent event-selection mode
data-selection-activeSelection toolbar UIThe toolbar has an active selected set
data-filterableCategory legend UICategory legend items can toggle filters
data-filteringCategory legend UIA category filter is active
data-hoveredCategory legend UI itemsThe category item is hovered

#Styling

Attach selectors to public parts and state attributes.

[data-slot='scheduler-month-cell'][data-today] {
    outline: 2px solid var(--p-primary-color);
}

[data-slot='scheduler-time-grid-event'][data-selected] {
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--p-primary-color) 55%, transparent);
}

[data-slot='scheduler-timeline-event'][data-resource-id='service-bay-4'] {
    border-inline-start-color: var(--p-purple-500);
}

[data-slot='scheduler-more-popover'][data-view='month'] {
    max-width: min(28rem, 92vw);
}

#Testing

Use data-slot for stable queries and combine it with a state attribute only when the assertion is about that state.

expect(page.locator('[data-slot="scheduler-month-cell"][data-today]')).toBeVisible();
expect(page.locator('[data-slot="scheduler-quick-info"]')).toHaveCount(1);

Prefer user-facing assertions when behavior matters. Use data attributes to find stable Scheduler surfaces, then assert visible text, ARIA state, selected state, or drag validity.