일정표 보기는 하나의 시트에 담은 팀 캘린더입니다. 기간을 이동하는 헤더, 일정 데이터를 바탕으로 구성한 해당 기간의 보기, 사용자가 열어 본 일정의 세부 정보로 구성됩니다. 캘린더 자체는 일정표와 그 동작이 담당하고, 블록은 시트, 실제 한 주의 일정, 드로어를 추가합니다.
일정표 보기
<section class="sheet p-lg" data-example="schedule-view" aria-label="Team calendar"> <div class="schedule-view" id="team"> <div class="schedule-view-header"> <button type="button" class="btn btn-sm schedule-view-today">Today</button> <button type="button" class="btn btn-sm btn-square btn-quiet schedule-view-previous" aria-label="Previous"> <svg class="icon" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"> <path d="M6 3.5L10.3586 7.8586A0.2 0.2 0 0 1 10.3586 8.1414L6 12.5" transform="rotate(180 8 8)" /> </svg> </button> <button type="button" class="btn btn-sm btn-square btn-quiet schedule-view-next" aria-label="Next"> <svg class="icon" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"> <path d="M6 3.5L10.3586 7.8586A0.2 0.2 0 0 1 10.3586 8.1414L6 12.5" /> </svg> </button> <h2 class="schedule-view-title" aria-live="polite">November 2026</h2> <div class="segmented segmented-sm schedule-view-switch" role="radiogroup" aria-label="View"> <label class="segmented-item"> <input type="radio" class="segmented-input" name="team-view" value="day">Day</label> <label class="segmented-item"> <input type="radio" class="segmented-input" name="team-view" value="week">Week</label> <label class="segmented-item"> <input type="radio" class="segmented-input" name="team-view" value="month" checked>Month</label> <label class="segmented-item"> <input type="radio" class="segmented-input" name="team-view" value="agenda">Agenda</label> </div> </div> <div class="schedule-view-body"></div> </div> <dialog class="dialog dialog-drawer" id="team-event" closedby="any" aria-labelledby="team-event-title"> <header class="dialog-header"> <p class="m(0)"> <span class="badge badge-category badge-dot" id="team-event-calendar"></span> </p> <h2 class="dialog-title" id="team-event-title"></h2> <p class="dialog-description" id="team-event-when"></p> </header> <div class="dialog-body"> <dl class="data-list"> <div class="data-list-item"> <dt class="data-list-term">Where</dt> <dd class="data-list-value" id="team-event-where"></dd> </div> <div class="data-list-item"> <dt class="data-list-term">Who</dt> <dd class="data-list-value" id="team-event-who"></dd> </div> </dl> </div> <footer class="dialog-footer"> <button type="button" class="btn" commandfor="team-event" command="close">Close</button> </footer> </dialog></section>import { schedule } from '@master/ui/behaviors/schedule.js'import { calendars, events } from './events.js'/** * A team calendar: the schedule behavior writes the period from the events, and an event, a button without a * link, opens its details in a drawer. Returns the function that stops it. */export function mount(root) { const view = root.querySelector('.schedule-view') const dialog = root.querySelector('dialog') const field = (name) => root.querySelector(`#team-event-${name}`) const detach = schedule(view, { events, today: '2026-11-13', locale: 'en-US', weekStart: 1, value: { date: '2026-11-13', view: 'month' } }) const controller = new AbortController() view.addEventListener('click', (click) => { const button = click.target.closest('button.schedule-event') const event = button && events.find((each) => each.id === button.value) if (!event) return const badge = field('calendar') badge.className = `badge badge-category badge-dot category-${event.category}` badge.textContent = calendars[event.category] field('title').textContent = event.title field('when').textContent = button.getAttribute('aria-label').slice(event.title.length + 2) field('where').textContent = event.where field('who').textContent = event.who // A day's list is a popover in the top layer; the drawer goes over it, and the list closes behind it. The // event's own button is then hidden, so when the drawer closes focus goes to the button that opened the list. const list = button.closest('[popover]') const opener = list ? view.querySelector(`[popovertarget="${list.id}"]`) : null list?.hidePopover() if (opener) dialog.addEventListener('close', () => opener.focus(), { once: true, signal: controller.signal }) dialog.showModal() }, { signal: controller.signal }) return () => { controller.abort() detach() if (dialog.open) dialog.close() }}/** * A week of a design team's calendar, as an application hands it to the schedule: days for all-day events, * local times for the others, each end exclusive, and a category for the calendar it belongs to. */export const calendars = { violet: 'Research', teal: 'Design system', orange: 'Launch', blue: 'Customers', green: 'Team',}export const events = [ { id: 'interviews', title: 'User interviews', start: '2026-11-03T10:00', end: '2026-11-03T11:30', category: 'violet', where: 'Room 4', who: 'Yi-ching, Misaki' }, { id: 'offsite', title: 'Design offsite', start: '2026-11-07', end: '2026-11-11', allDay: true, category: 'green', where: 'Lisbon', who: 'The whole team' }, { id: 'audit', title: 'Token audit', start: '2026-11-10T13:00', end: '2026-11-10T15:00', category: 'teal', where: 'Online', who: 'Kenta, Ji-hoon' }, { id: 'deploy', title: 'Deploy window', start: '2026-11-12T22:00', end: '2026-11-13T01:00', category: 'orange', where: 'On call', who: 'Seo-yeon' }, { id: 'launch', title: 'Launch day', start: '2026-11-13', end: '2026-11-14', allDay: true, category: 'orange', where: 'Everywhere', who: 'Everyone' }, { id: 'standup', title: 'Standup', start: '2026-11-13T09:00', end: '2026-11-13T09:15', category: 'green', where: 'Online', who: 'The whole team' }, { id: 'review', title: 'Design review', start: '2026-11-13T10:00', end: '2026-11-13T11:30', category: 'teal', where: 'Room 2', who: 'Yi-ching, Kenta' }, { id: 'lunch', title: 'Team lunch', start: '2026-11-13T12:00', end: '2026-11-13T13:00', category: 'green', where: 'Canteen', who: 'The whole team' }, { id: 'call', title: 'Customer call', start: '2026-11-13T14:00', end: '2026-11-13T15:00', category: 'blue', where: 'Online', who: 'Misaki' }, { id: 'retro', title: 'Retro', start: '2026-11-13T16:30', end: '2026-11-13T17:15', category: 'green', where: 'Room 4', who: 'The whole team' }, { id: 'planning', title: 'Planning', start: '2026-11-17T09:30', end: '2026-11-17T11:00', category: 'teal', where: 'Room 2', who: 'Ji-hoon' }, { id: 'synthesis', title: 'Research synthesis', start: '2026-11-18T14:00', end: '2026-11-18T16:00', category: 'violet', where: 'Room 4', who: 'Yi-ching' }, { id: 'conference', title: 'Design conference', start: '2026-11-19', end: '2026-11-22', allDay: true, category: 'violet', where: 'Berlin', who: 'Yi-ching, Misaki' }, { id: 'onboarding', title: 'Onboarding', start: '2026-11-24T10:00', end: '2026-11-24T12:00', category: 'blue', where: 'Room 1', who: 'Seo-yeon' },]날짜 숫자를 눌러 그날을 열거나, 일정을 눌러 세부 정보를 열거나, 주간 보기나 일정 목록으로 전환해 보세요.
블록은 복사해 사용하는 마크업입니다. 페이지의 텍스트 색상과 크기를 따르며, 미리보기에서는 body에 fg-text-body text-sm 클래스를 설정합니다. 각 블록은 크기 컨테이너이므로 넓은 페이지, 사이드바 너비의 공간, 대화 상자 어디서든 자체 너비에 맞춰 배치가 바뀝니다.
#구성 요소
- 하나의 시트. 시트에
schedule-view가 들어갑니다. 헤더에는 오늘, 이전, 다음 버튼, 바뀔 때 안내되는 기간 이름, 일간·주간·월간·일정 목록을 전환하는 세그먼트 컨트롤이 있습니다. - 일정은 데이터입니다.
events.js는 애플리케이션이 넘겨주는 형태의 한 주 일정입니다. 종일 일정은 날짜로, 나머지는 현지 시각으로 지정하고, 각 종료 시점은 포함하지 않으며, 각 일정에 소속 캘린더를 나타내는 카테고리를 지정합니다.schedule동작이 일정을 배치하며, 일정을 편집하거나 저장하지는 않습니다. - 카테고리에는 이름이 있습니다. 각 캘린더의 색상은 드로어의 배지에 이름과 함께 표시되고, 일정의 제목이 일정의 내용을 알려 줍니다.
- 일정을 누르면 드로어가 열립니다. 링크가 없는 일정은 id를
value로 갖는 버튼입니다. 페이지는 이 버튼의 이벤트를 수신해 대화 상자 드로어에 시간, 장소, 참석자를 채웁니다. 하루의 일정 목록은 팝오버이며, 드로어가 열리면 그 뒤에서 닫힙니다. - 좁은 공간에서도 계속 읽을 수 있습니다. 월간 보기는 날짜 숫자 아래에 일정마다 점을 하나씩 표시하고, 헤더는 기간 이름을 별도의 줄에 두며, 일정 목록은 한 달을 날짜별로 나열합니다.
#스크립트가 필요한 동작
main.js는 일정 데이터와 오늘 날짜로 동작을 연결하고 드로어를 엽니다. 기간과 보기 사이의 이동, 월간·주간 보기와 일정 목록의 배치는 동작이 담당합니다. 일정의 생성, 이동, 저장과 시간대, 반복 일정은 애플리케이션이 처리하며, 애플리케이션은 일정표가 표시하는 기간의 일정을 넘겨줍니다.
#접근성
- 시트의 이름은 “Team calendar”이며, 기간 이름은 이동한 위치를 알려 주는 라이브 영역입니다.
- 날짜 숫자의 이름에는 날짜와 그날의 일정 수가 포함되며, 더 보기 버튼은 어느 날짜에 일정이 몇 개 더 있는지 알려 줍니다.
- 일정의 이름에는 제목과 시각이 포함됩니다. 드로어는 일정 제목으로 이름을 지정한 모달 대화 상자이며, 닫히면 포커스를 일정으로 되돌립니다.
- 카테고리 색상만 단독으로 사용하지 않습니다. 카테고리 이름은 드로어에 표시됩니다.
#관련 항목
- 일정표하루나 일주일의 일정은 세로 시간축에, 한 달의 일정은 주별 레인에 배치합니다. 일정 목록으로도 표시할 수 있습니다.
- 세그먼트 컨트롤하나의 오목한 영역에 몇 가지 옵션을 배치하고, 솟아오른 표면이 현재 옵션으로 부드럽게 이동합니다.
- 대화 상자스크립트 없이 열고 닫는 오버레이 시트 형태의 네이티브 모달입니다.
- 데이터 목록배포, 주문, 프로필처럼 한 대상의 정보를 가는 선으로 나눈 항목 이름과 값으로 보여 줍니다.
- 배지상태, 카테고리 또는 개수를 표시하는 작은 칩입니다. 색에 의미가 있을 때만 색을 사용합니다.
- 카테고리 색상데이터가 어느 카테고리에 속하는지 알려 주는 이름이 지정된 색상입니다.
- 팝오버팝오버를 여는 버튼을 기준으로 배치되는 떠 있는 패널입니다.
- 표면모든 컴포넌트의 바탕이 되는 트레이, 볼록한 표면, 오목한 영역의 높이 체계입니다.
- 버튼표면 위로 살짝 돌출되어 있으며, 포인터를 올리면 떠오르고 누르면 가라앉는 버튼입니다.