By default, the JavaScript Scheduler fills the available width of a block-level host. Set width to size it explicitly, or size the containing element with CSS to let it follow the layout.
Use a number such as 800 for pixels or a CSS string such as "800px" or "80%". Numeric widths are supported in Pro since 2026.4.7170 and in Lite since 2026.4.902.
Set the value during initialization or change it with update after the component is displayed.
Set the Scheduler width
JavaScript
const dp = new DayPilot.Scheduler("dp", {width: 800});
dp.init();
// Fill the container when switching to the flexible layout.
dp.update({width: "100%"});Angular
<daypilot-scheduler [config]="config"></daypilot-scheduler>config: DayPilot.SchedulerConfig = {
width: 800
};React
<DayPilotScheduler width={800} />Vue
<DayPilotScheduler :width="800" />Size the container with CSS
API: events.list, resources.
These examples leave the Scheduler's width unset and size its parent instead. The parent is 800 pixels wide and shrinks to fit narrower screens.
The framework examples use DayPilot Pro. For installation, see the Angular, React or Vue Scheduler guide.
Angular
Apply width and max-width to the containing div in the component template.
import {Component} from "@angular/core";
import {DayPilot, DayPilotModule} from "daypilot-pro-angular";
@Component({
selector: "app-scheduler-example",
standalone: true,
imports: [DayPilotModule],
template: `
<div style="width: 800px; max-width: 100%;">
<daypilot-scheduler [config]="config"></daypilot-scheduler></div>
`
})
export class SchedulerExampleComponent {
config: DayPilot.SchedulerConfig = {
startDate: "2026-11-01",
days: 30,
scale: "Day",
timeHeaders: [{groupBy: "Month"}, {groupBy: "Day", format: "d"}],
resources: [{id: "A", name: "Room A"}, {id: "B", name: "Room B"}],
events: [{id: 1, text: "Planning", resource: "A", start: "2026-11-03", end: "2026-11-06"}, {id: 2, text: "Delivery", resource: "B", start: "2026-11-08", end: "2026-11-11"}]
};
}
React
Use the parent element's style object, with maxWidth in React's camel-case CSS syntax.
import React from "react";
import {DayPilot, DayPilotScheduler} from "daypilot-pro-react";
export default function SchedulerExample() {
return <div style={{width: "800px", maxWidth: "100%"}}>
<DayPilotScheduler
startDate={"2026-11-01"}
days={30}
scale={"Day"}
timeHeaders={[{groupBy: "Month"}, {groupBy: "Day", format: "d"}]}
resources={[{id: "A", name: "Room A"}, {id: "B", name: "Room B"}]}
events={[{id: 1, text: "Planning", resource: "A", start: "2026-11-03", end: "2026-11-06"}, {id: 2, text: "Delivery", resource: "B", start: "2026-11-08", end: "2026-11-11"}]}
/>
</div>;
}
Vue
The parent div uses an ordinary CSS style attribute; the Scheduler receives its data through individual bindings.
<script setup>
import {DayPilot, DayPilotScheduler} from "daypilot-pro-vue";
const startDate = "2026-11-01";
const days = 30;
const scale = "Day";
const timeHeaders = [{groupBy: "Month"}, {groupBy: "Day", format: "d"}];
const resources = [{id: "A", name: "Room A"}, {id: "B", name: "Room B"}];
const events = [{id: 1, text: "Planning", resource: "A", start: "2026-11-03", end: "2026-11-06"}, {id: 2, text: "Delivery", resource: "B", start: "2026-11-08", end: "2026-11-11"}];
</script>
<template>
<div style="width: 800px; max-width: 100%;">
<DayPilotScheduler
:startDate="startDate"
:days="days"
:scale="scale"
:timeHeaders="timeHeaders"
:resources="resources"
:events="events"
/>
</div>
</template>
ASP.NET WebForms
Example:
<DayPilot:DayPilotScheduler
runat="server"
id="DayPilotScheduler1"
Width="100%"
...
/>ASP.NET MVC
Example:
@Html.DayPilotScheduler("dps", new DayPilotSchedulerConfig {
BackendUrl = ResolveUrl("~/Scheduler/Backend"),
Width = "100%",
...
})
Java
Example:
<div id="dps"></div>
<script type="text/javascript">
var dps = new DayPilot.Scheduler("dps");
dps.backendUrl = "${pageContext.request.contextPath}/dps";
dps.width = "100%";
// ...
dps.init();
</script>
Availability
Availability of this feature in DayPilot editions:
| Product | Lite | Pro |
|---|---|---|
| DayPilot for JavaScript | ||
| DayPilot for ASP.NET WebForms | ||
| DayPilot for ASP.NET MVC | ||
| DayPilot for Java |
DayPilot