<sessions-schedule>Renders the same schedule shown on a business’s public Sessions page. Includes filters, day/week/month toggles, and a sign-in flow that lets visitors book without leaving the host page when an auth token is supplied. The week view is a time grid — hours down the left, each session positioned at its real start and end — matching the public page; use week-start-time / week-end-time to fix which hours it shows instead of letting it size itself to the sessions. Its properties, methods and events let your page follow what the visitor is looking at — the open session, the view and day, the filters, a booking — and open a session itself (booking mode has none of these; <sessions-appointments> is the scriptable appointment picker). Set structure="booking" to present booking mode — a “what to book” chooser over the appointment time picker — for businesses that take appointments. For a page that draws its own chooser and Book button around the time picker, use <sessions-appointments>. For a theatre or cinema, a performance’s sheet links to “All performances”, which opens the show’s whole run over it — poster, ticket price and every performance with what is left — so a visitor can pick another night without leaving the sheet. That overlay raises no event of its own.
Install
<script type="module" src="https://assets.sessions.website/embeds/unstable/schedule.js"></script>
<sessions-schedule
business="still-water-yoga-demo"
>
<div class="sx" aria-hidden="true"><style>.sx{--sx-fill:color-mix(in srgb,var(--sessions-color-surface-primary-text,var(--sessions-text,currentColor)) 10%,transparent);--sx-cell:color-mix(in srgb,var(--sessions-color-surface-primary-text,var(--sessions-text,currentColor)) 2%,transparent);--sx-rule:color-mix(in srgb,var(--sessions-color-surface-primary-text,var(--sessions-text,currentColor)) 5%,transparent);display:block;color-scheme:var(--sessions-color-scheme,light)}.sx *{box-sizing:border-box}.sx-bar{display:block;border-radius:.25rem;background:var(--sx-fill);animation:sx-pulse 1.6s ease-in-out infinite}.sx-grid{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:1px;background:var(--sx-rule);overflow:hidden;border-radius:.5rem}.sx-head{padding:.5rem;text-align:center;background:var(--sx-cell)}.sx-head .sx-bar{height:.55rem;width:1.5rem;margin:0 auto}.sx-cell{min-height:5.5rem;padding:.375rem;background:var(--sx-cell);display:flex;flex-direction:column;gap:.25rem}.sx-dot{width:1.5rem;height:1.5rem;border-radius:50%;background:var(--sx-fill)}.sx-cols{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:1px;background:var(--sx-rule);overflow:hidden;border-radius:.5rem}.sx-col{background:var(--sx-cell);display:flex;flex-direction:column}.sx-colhead{display:flex;flex-direction:column;align-items:center;gap:.25rem;padding:.5rem .25rem}.sx-colbody{display:flex;flex-direction:column;gap:2px;padding:.25rem;flex:1}.sx-entry{height:2.25rem;border-radius:.25rem;background:var(--sx-fill);animation:sx-pulse 1.6s ease-in-out infinite}.sx-rows{display:flex;flex-direction:column;background:var(--sx-cell);border-radius:.5rem;overflow:hidden}.sx-row{display:grid;grid-template-columns:minmax(0,5fr) minmax(0,3fr);align-items:center;column-gap:1rem;padding:.75rem 1rem;min-height:3.25rem}.sx-row+.sx-row{border-top:1px solid var(--sx-rule)}.sx-main{display:flex;flex-direction:column;gap:.3125rem;min-width:0}.sx-staff{display:flex;align-items:center;gap:.5rem;min-width:0}.sx-avatar{width:1.5rem;height:1.5rem;border-radius:50%;background:var(--sx-fill);flex-shrink:0;animation:sx-pulse 1.6s ease-in-out infinite}.sx-toolbar{display:flex;align-items:center;justify-content:space-between;gap:.5rem;margin-bottom:.75rem}.sx-toolbar .sx-bar{height:1rem}@keyframes sx-pulse{0%,100%{opacity:.55}50%{opacity:1}}@media (prefers-reduced-motion:reduce){.sx-bar,.sx-entry,.sx-avatar{animation:none;opacity:.7}}</style><div class="sx-toolbar"><span class="sx-bar" style="width:7rem;height:1rem"></span><span style="display:flex;gap:.375rem"><span class="sx-bar" style="width:2.25rem;height:1.5rem"></span><span class="sx-bar" style="width:2.25rem;height:1.5rem"></span><span class="sx-bar" style="width:2.25rem;height:1.5rem"></span></span></div><div class="sx-cols"><div class="sx-col"><div class="sx-colhead"><span class="sx-bar" style="width:1.25rem;height:.5rem"></span><span class="sx-dot" style="width:1.625rem;height:1.625rem"></span></div><div class="sx-colbody"><span class="sx-entry"></span><span class="sx-entry"></span></div></div><div class="sx-col"><div class="sx-colhead"><span class="sx-bar" style="width:1.25rem;height:.5rem"></span><span class="sx-dot" style="width:1.625rem;height:1.625rem"></span></div><div class="sx-colbody"><span class="sx-entry"></span></div></div><div class="sx-col"><div class="sx-colhead"><span class="sx-bar" style="width:1.25rem;height:.5rem"></span><span class="sx-dot" style="width:1.625rem;height:1.625rem"></span></div><div class="sx-colbody"><span class="sx-entry"></span><span class="sx-entry"></span><span class="sx-entry"></span></div></div><div class="sx-col"><div class="sx-colhead"><span class="sx-bar" style="width:1.25rem;height:.5rem"></span><span class="sx-dot" style="width:1.625rem;height:1.625rem"></span></div><div class="sx-colbody"><span class="sx-entry"></span><span class="sx-entry"></span></div></div><div class="sx-col"><div class="sx-colhead"><span class="sx-bar" style="width:1.25rem;height:.5rem"></span><span class="sx-dot" style="width:1.625rem;height:1.625rem"></span></div><div class="sx-colbody"><span class="sx-entry"></span></div></div><div class="sx-col"><div class="sx-colhead"><span class="sx-bar" style="width:1.25rem;height:.5rem"></span><span class="sx-dot" style="width:1.625rem;height:1.625rem"></span></div><div class="sx-colbody"></div></div><div class="sx-col"><div class="sx-colhead"><span class="sx-bar" style="width:1.25rem;height:.5rem"></span><span class="sx-dot" style="width:1.625rem;height:1.625rem"></span></div><div class="sx-colbody"><span class="sx-entry"></span><span class="sx-entry"></span></div></div></div></div>
</sessions-schedule>Attributes
Edit any attribute below — the snippet above and the live preview to the side rebuild in place.
business : stringHandle of the business whose schedule should be shown, without the leading @. Optional when a wrapping <sessions-context business="…"> already provides it.
structure : schedule | bookingWhich surface to present. schedule (default) shows the session calendar. booking shows booking mode — a “what to book” chooser over the appointment time picker (Day), a drag-to-select grid (Week) and an availability month (Month) — for businesses that take appointments. <sessions-appointments> is its time picker on its own, for a page that draws the rest.
auth : tokenOptional embed-scoped JWT issued via the business-pinned sign-in flow. When set, bookings are made on behalf of the token holder.
view : auto | day | week | monthCalendar view the schedule opens on. auto (default) picks the view from the business’s upcoming session density — Day for a packed daily grid, Week for a few classes a week, Month for sparse schedules — matching the server’s recommendedScheduleView. Set day, week, or month to force one. A view the visitor selects (remembered per persist) always wins over this default.
persist : storage | urlHow active filters are remembered across navigation. storage (default) uses sessionStorage; url writes filter state to the host page’s query string.
week-start-time : stringPins the first hour of the week view’s time axis. Write it 24-hour (08:00, 8) or 12-hour (8am, 8:30 AM, 8 a.m.) — a bare number is always 24-hour, so 20 is 8pm. Minutes round down to the hour that contains them. The week view always shows a time grid with the hours down the left — by default that axis sizes itself to the week’s sessions (or, in booking mode, to the activity’s booking hours), and this fixes it instead, so the same hours are shown every week. A session outside the pinned window is clamped to the nearest edge rather than hidden. Unparseable values are ignored.
week-end-time : stringPins the last hour of the week view’s time axis, in the same formats as week-start-time (21:00, 21, 9pm); minutes round up to the enclosing hour, and 24:00 (or 12am) means midnight at the end of the day. Can be set on its own — the start of the axis then still fits the sessions.
show-price : booleanPrints what one place costs at the end of each day-view row, on a schedule wide enough to hold it. Off by default: the session’s sheet states the price, as the business’s Sessions page and apps do. Any value but false turns it on.
Scripting
Draw your own controls around the element and drive it from your page’s script: read its properties, set its attributes, call its methods and listen for its events.
<h2 id="heading">This week</h2>
<sessions-schedule business="your-business"></sessions-schedule>
<script type="module">
const schedule = document.querySelector('sessions-schedule');
const heading = document.querySelector('#heading');
schedule.addEventListener('sessions:view-change', (event) => {
const {view, range} = event.target.viewState;
heading.textContent = view === 'month' ? 'This month' : `Week of ${range.start}`;
});
schedule.addEventListener('sessions:session-open', (event) => {
heading.textContent = event.target.openSession.name;
});
schedule.addEventListener('sessions:booking-change', (event) => {
if (event.booking?.status === 'confirmed') {
console.log('Booked', event.session.name);
}
});
// Open a session from your own link or card.
document.querySelector('#featured')?.addEventListener('click', () => {
schedule.showSession('SESSION_ID');
});
</script>Properties
readonly openSession: ScheduleSession | null- The session whose sheet is open — its id, activity, time, availability and the visitor’s own booking — or
null. readonly viewState: ScheduleViewState | null- What the calendar shows: its view (
day,weekormonth), the chosen day, and the days the view covers.nulluntil the schedule renders. readonly filters: ScheduleFilters | null- The filters the visitor has applied: search, instructors, activities, times of day and booked / not booked.
nulluntil the schedule renders.
Methods
showSession(sessionId: string): void- Open a session’s sheet by id, bringing its day on screen and fetching it first when it isn’t loaded — what a
?session=link does, without touching your page’s URL. closeSession(): void- Close the open session’s sheet.
goToDate(day: string): void- Bring a day (
YYYY-MM-DD, in the business’s time zone) on screen in the current view.
Events
Each is its own Event subclass, dispatched on the element. Read the state it changed from the element: event.target.selection. What isn’t state, like the booking just made, is on the event itself: event.booking, never event.detail. They bubble and cross shadow roots, so you can listen on the element or any ancestor. Outside a shadow root that holds the element, event.target is that root’s host, so read the element from event.composedPath()[0].
sessions:session-openScheduleSessionOpenEventevent.target.openSession: ScheduleSession | null- A session’s sheet opened: the visitor picked it, or a
?session=link orshowSession()opened it. Use it to name the session in your own UI or track what visitors look at. sessions:session-closeScheduleSessionCloseEventevent.session: ScheduleSession- The open session’s sheet closed.
event.target.openSessionis alreadynull, soevent.sessionis the session that was open, as it stood when it closed. sessions:view-changeScheduleViewChangeEventevent.target.viewState: ScheduleViewState | null- The view, the chosen day or the days on screen changed. Fires once when the schedule renders, then on each change — keep your own date picker or heading in step with it.
sessions:filters-changeScheduleFiltersChangeEventevent.target.filters: ScheduleFilters | null- The visitor changed the filters.
sessions:booking-changeScheduleBookingChangeEventevent.session: ScheduleSessionevent.booking: ScheduleBooking | nullevent.guest: {name: string} | null- The visitor’s place on a session changed in its sheet: they booked or requested it, joined its waitlist, cancelled (
bookingisnull), or booked a guest (guestis set).
Types
interface ScheduleSession {
id: string;
activity: {id: string; name: string};
/** the session's name, or its activity's */
name: string;
/** ISO 8601 */
startAt: string | null;
endAt: string | null;
/** scheduled, cancelled, … */
status: string;
/** open, limited, full, …; null when it doesn't apply */
availability: string | null;
/** the session's page on Sessions */
url: string;
myBooking: ScheduleBooking | null;
}interface ScheduleBooking {
id: string;
/** confirmed, requested, waitlisted, offered, … */
status: string;
waitlistPosition: number | null;
}interface ScheduleViewState {
view: 'day' | 'week' | 'month';
/** YYYY-MM-DD in the business's time zone; null in Month with no day chosen */
selectedDay: string | null;
/** the week (Mon–Sun) in Day and Week, the whole month grid in Month */
range: {start: string; end: string};
}interface ScheduleFilters {
search: string;
staffIds: readonly string[];
activityIds: readonly string[];
timesOfDay: readonly ('morning' | 'afternoon' | 'evening')[];
booked: readonly ('registered' | 'notRegistered')[];
}Content Security Policy
If your site sets a Content-Security-Policy, allow these origins: the embed loads its files from assets.sessions.website, calls the Sessions API on go.sessions.website, and frames sign-in and maps from embed.sessions.website. Apps the business installed can also add rows to a session’s details. Each runs in a hidden, sandboxed frame from go.sessions.website, so allow that in frame-src too, or those rows will not load.
script-src https://assets.sessions.website;
connect-src https://assets.sessions.website https://go.sessions.website;
frame-src https://embed.sessions.website https://go.sessions.website;