Side sheet
A modal panel that slides in from the side of the window to hold navigation on phones: the site header's menu, and the admin console's drawer below 768px.
When to use
- The phone menu of a site header: below 1024px a 48px "Menu" button opens the header's links, the language switcher, and "Sign in" in a side sheet from the inline end (D-CSN-12, canonical §10.14).
- The navigation of a console with more than five or grouped destinations, below 768px: a "Menu" button under the app bar opens the drawer as a side sheet from the inline start (D-CSN-13, canonical §10.15).
When not to use
- A member app with two to five destinations: the navigation bar below 768px and the navigation rail from 768px.
- Wide windows: from 1024px the site header shows its links; from 768px a console shows the navigation drawer as a column. Never keep a side sheet as the only navigation on a wide screen (canonical §10.14, §10.15).
- A task, a form, or a confirmation: a dialog or a bottom sheet. Filters on phones open in a bottom sheet (canonical §11 row 4).
- A panel that stays beside the content (an apply card, a guide): a layout column of
--size-side-pane, not an overlay.
Anatomy
- Scrim: black at 32%,
--color-scrim. - Container (
.oa-side-sheetwith--endor--start):surface-raised,shadow-elevation-3, a transparent 1px edge, the full height of the window. The two corners that face the page arerounded-sheet(28px); the side attached to the screen edge is square (D-SEM-05). - Header row (
.oa-dialog__header): the title (.oa-dialog__title, "Menu" intitle-lg) at the inline start and the 48px close button (.oa-dialog__close) at the inline end, its icon in line with the padding. - Content, 24px below the header:
- the phone menu:
.oa-nav-sheetfrom site-header.md: the navigation items as 56px pills, a divider, the language row (the two-language switcher.oa-lang.oa-lang--two), the quiet actions as full-width outlined buttons; - the admin drawer:
.oa-nav-drawer.oa-nav-drawer--sheetfrom navigation-drawer.md: group disclosures, 56px items, a divider, the outlined "Back to …" button.
- the phone menu:
Variants
| Variant | Use for | Key classes and tokens |
|---|---|---|
| End (default) | The site header's phone menu | .oa-side-sheet--end: attached to the inline end, the right in English and the left in Arabic; the inline-start corners rounded |
| Start | The admin console's drawer below 768px | .oa-side-sheet--start: attached to the inline start; the inline-end corners rounded |
Sizes
| Part | Size | Token |
|---|---|---|
| Width | 85% of the window, at most 384px | --container-side-sheet (w-[85vw] max-w-side-sheet) (D-ARC-24) |
| Height | the full window | h-dvh (canonical §4.10) |
| Padding | 24px, plus the top and bottom safe areas and the safe area of the attached side | --space-6; reference CSS --oa-safe-top, --oa-safe-bottom, and --oa-safe-start or --oa-safe-end (they follow the direction, so the Arabic end sheet pads the left inset with no override); Tailwind env(safe-area-inset-*) |
| Header row | 48px: the close button; the title in title-lg (20/28) |
--size-button-md, --text-title-lg |
| Gap | 24px between the header row and the content | --space-stack-loose |
| Items | 56px pills (phone menu and drawer) | --size-list-row |
Tokens
| Part | Property | Token (CSS · Tailwind) |
|---|---|---|
| Container | background, text | --color-surface-raised · bg-surface-raised; --color-on-surface |
| Container | shadow, edge | --shadow-elevation-3; 1px transparent |
| Container | corners | --radius-sheet on the free corners · rounded-s-sheet (end sheet) or rounded-e-sheet (start sheet) |
| Container | layer | --z-modal · z-50; a native modal sits in the top layer |
| Title | type, color | --text-title-lg · text-title-lg; --color-on-surface |
| Scrim | background | --color-scrim · bg-scrim |
| Motion | enter | 100% from its edge to 0 over --duration-short-4 with --ease-emphasized, mirrored in Arabic |
| Motion | exit | back to its edge over --duration-short-3 with --ease-emphasized-accelerate |
States
| State | What changes |
|---|---|
| Opening | Slides in from its edge over duration-short-4 with ease-emphasized; the scrim fades in over duration-short-3 (D-SEM-16, D-CSN-12). |
| Open | Focus inside and held; the page behind inert and still; the menu button shows [aria-expanded="true"]. |
| Closing | Slides back over duration-short-3 with ease-emphasized-accelerate; focus returns to the menu button. |
| Items | Rest, hover (8%), pressed (12%), focus (the ring), current ([aria-current="page"]: the primary-container pill, weight 700): owned by the nav sheet and the drawer. |
Behavior
- The trigger: a 48px icon button with the menu icon, named "Menu" ("القائمة"), with
[aria-expanded]and[aria-controls]pointing at the sheet; it is the last item of the header's end cluster (D-CSN-12). In consoles it is the 48px "Menu" row under the app bar, which keeps the visible word (D-CSN-13). - Modal: a native
<dialog class="oa-side-sheet">opened withshowModal(), or Radix Dialog. Focus moves in and stays there; the first item takes focus (autofocus). - Ways out: Escape, a press on the scrim, the close button, and choosing a link. Focus returns to the menu button (D-CSN-12).
- Only on narrow windows: the site header hides the menu button from 1024px when it shows its links; the admin shell shows the drawer as a column from 768px. Close an open sheet when the window crosses that width.
- Reduced motion: the sheet appears and leaves at once (D-SEM-21).
menuButton.addEventListener('click', () => {
sheet.showModal();
menuButton.setAttribute('aria-expanded', 'true');
});
sheet.addEventListener('close', () => menuButton.setAttribute('aria-expanded', 'false'));
sheet.addEventListener('click', (event) => {
if (event.target.closest('a[href]')) sheet.close(); // a choice closes it
// a press on the scrim: as in dialog.md
});Accessibility
- Role and name: a modal
<dialog>named by its title ("Menu") through[aria-labelledby]. The links inside sit in a<nav>with its own name ("Main", "Admin console"). - The trigger reports its state with
[aria-expanded]and points at the sheet with[aria-controls]. - Keyboard: Tab moves through the items and stays inside; Escape closes; disclosures in the drawer open with Enter or Space.
- Current page:
[aria-current="page"]on the item, plus the pill and the bold weight, so it never relies on color (D-CSN-14). - Targets: 56px items; 48px for the close button and the language row (D-LAY-12).
- Contrast on
surface-raised:on-surface17.12:1 light and 11.10:1 dark;on-surface-variant(idle items) 9.33:1 and 8.42:1 (tokens/contrast.md). - Reduced motion: no slide (D-SEM-21).
RTL and languages
- An end sheet attaches to the left edge in Arabic and slides in from there; its rounded corners face the page on the right. A start sheet does the opposite. overlay.css mirrors the slide with
:dir(rtl); never write a separate Arabic sheet (D-BCP-30). - The safe-area inset follows the physical side the sheet touches, so it is padded on the right in English and on the left in Arabic (canonical §4.10).
- The title and the close button swap sides with the direction; the back arrow of "Back to …" mirrors (
.oa-icon--mirror). - Names in three languages: "Menu" / "القائمة" / "Menu"; "Close" / "إغلاق" / "Fermer".
Content
- Title: "Menu" in every sheet (canonical §10.14).
- Items: the same labels as the header's links or the drawer's places, in sentence case: "Find jobs", "For employers"; "People", "Add a person", "Photos".
- Language row: the two-language switcher (language-switcher.md): the other language in its own script with its
lang("العربية", "English") and the hidden "Switch to Arabic" / "التبديل إلى الإنجليزية", a 48px pill inlabel-md(canonical §10.28). - Quiet actions: verb first from the glossary: "Sign in" / "تسجيل الدخول".
- The way out of a console: "Back to my Global ID" / "العودة إلى Global ID الخاص بي" / "Retour à mon Global ID". The product name sits in
<bdi lang="en" translate="no">, Latin and in one piece in every language (D-BCP-03).
Do and don't
- Do give every header with links the menu button below 1024px. Don't leave a phone without its navigation.
- Do trap focus, close on Escape, and return focus to the menu button. Don't open a non-modal panel that lets Tab wander behind it.
- Do round only the two corners that face the page. Don't round the side that touches the screen.
- Do keep the sheet narrow (85% up to 384px), so the page shows behind the scrim. Don't cover the whole window.
Code
HTML (reference CSS)
The snippet's examples (reference/snippets/overlays.html). The .oa-scrim--demo frame and the [open] attribute are for documentation only; in a product open the <dialog> with showModal() and put autofocus on the first item.
Phone menu (Global Jobs, below 1024px):
<div class="oa-scrim oa-scrim--demo">
<dialog class="oa-side-sheet oa-side-sheet--end" open aria-labelledby="ov-menu-title">
<div class="oa-dialog__header">
<h2 class="oa-dialog__title" id="ov-menu-title">Menu</h2>
<button class="oa-icon-btn oa-dialog__close" type="button" aria-label="Close">
<span class="oa-icon" aria-hidden="true" translate="no">close</span>
</button>
</div>
<div class="oa-nav-sheet">
<nav aria-label="Main">
<ul class="oa-nav-sheet__list">
<li><a class="oa-nav-sheet__item" href="#jobs" aria-current="page">Find jobs</a></li>
<li><a class="oa-nav-sheet__item" href="#employers">For employers</a></li>
</ul>
</nav>
<hr class="oa-nav-sheet__divider">
<div class="oa-nav-sheet__section">
<a class="oa-lang oa-lang--two" href="#ar" hreflang="ar">
<span class="oa-icon oa-icon--md" aria-hidden="true" translate="no">translate</span>
<span lang="ar">العربية</span><span class="oa-visually-hidden">Switch to Arabic</span>
</a>
</div>
<div class="oa-nav-sheet__section">
<a class="oa-btn oa-btn--outlined oa-btn--wide" href="#sign-in">Sign in</a>
</div>
</div>
</dialog>
</div>Admin drawer (Global ID, below 768px):
<div class="oa-scrim oa-scrim--demo">
<dialog class="oa-side-sheet oa-side-sheet--start" open aria-labelledby="ov-admin-title">
<div class="oa-dialog__header">
<h2 class="oa-dialog__title" id="ov-admin-title">Menu</h2>
<button class="oa-icon-btn oa-dialog__close" type="button" aria-label="Close">
<span class="oa-icon" aria-hidden="true" translate="no">close</span>
</button>
</div>
<nav class="oa-nav-drawer oa-nav-drawer--sheet" aria-label="Admin console">
<div class="oa-nav-drawer__group">
<button class="oa-nav-drawer__group-btn" type="button" aria-expanded="true" aria-controls="ov-admin-directory">
<span class="oa-nav-drawer__group-label" id="ov-admin-directory-title">Directory</span>
<span class="oa-icon oa-nav-drawer__chevron" aria-hidden="true" translate="no">expand_more</span>
</button>
<ul class="oa-nav-drawer__list" id="ov-admin-directory" aria-labelledby="ov-admin-directory-title">
<li><a class="oa-nav-drawer__item" href="#people" aria-current="page"><span class="oa-icon oa-nav-drawer__icon" aria-hidden="true" translate="no">group</span><span class="oa-nav-drawer__label">People</span></a></li>
<li><a class="oa-nav-drawer__item" href="#add"><span class="oa-icon oa-nav-drawer__icon" aria-hidden="true" translate="no">person_add</span><span class="oa-nav-drawer__label">Add a person</span></a></li>
<li><a class="oa-nav-drawer__item" href="#photos"><span class="oa-icon oa-nav-drawer__icon" aria-hidden="true" translate="no">photo_camera</span><span class="oa-nav-drawer__label">Photos</span></a></li>
</ul>
</div>
<hr class="oa-nav-drawer__divider">
<a class="oa-btn oa-btn--outlined oa-btn--wide oa-nav-drawer__back" href="#my-id">
<span class="oa-icon oa-icon--mirror oa-btn__icon" aria-hidden="true" translate="no">arrow_back</span>
<span class="oa-btn__label">Back to my <bdi lang="en" translate="no">Global ID</bdi></span>
</a>
</nav>
</dialog>
</div>Arabic, on a page with <html lang="ar" dir="rtl">:
<div class="oa-scrim oa-scrim--demo">
<dialog class="oa-side-sheet oa-side-sheet--end" open aria-labelledby="ov-menu-ar-title">
<div class="oa-dialog__header">
<h2 class="oa-dialog__title" id="ov-menu-ar-title">القائمة</h2>
<button class="oa-icon-btn oa-dialog__close" type="button" aria-label="إغلاق">
<span class="oa-icon" aria-hidden="true" translate="no">close</span>
</button>
</div>
<div class="oa-nav-sheet">
<nav aria-label="القائمة الرئيسية">
<ul class="oa-nav-sheet__list">
<li><a class="oa-nav-sheet__item" href="#ar-jobs" aria-current="page">ابحث عن وظيفة</a></li>
<li><a class="oa-nav-sheet__item" href="#ar-employers">لأصحاب العمل</a></li>
</ul>
</nav>
<hr class="oa-nav-sheet__divider">
<div class="oa-nav-sheet__section">
<a class="oa-lang oa-lang--two" href="#en" hreflang="en">
<span class="oa-icon oa-icon--md" aria-hidden="true" translate="no">translate</span>
<span lang="en">English</span><span class="oa-visually-hidden">التبديل إلى الإنجليزية</span>
</a>
</div>
<div class="oa-nav-sheet__section">
<a class="oa-btn oa-btn--outlined oa-btn--wide" href="#ar-sign-in">تسجيل الدخول</a>
</div>
</div>
</dialog>
</div>Tailwind CSS v4
<!-- Dialog.Content as an end sheet (the phone menu); the overlay is the dialog's (bg-scrim) -->
<div class="fixed inset-y-0 end-0 z-50 flex h-dvh w-[85vw] max-w-side-sheet flex-col gap-stack-loose overflow-auto overscroll-contain rounded-s-sheet border border-transparent bg-surface-raised pt-[calc(var(--space-6)+env(safe-area-inset-top))] pb-[calc(var(--space-6)+env(safe-area-inset-bottom))] ps-6 pe-[calc(var(--space-6)+env(safe-area-inset-right))] rtl:pe-[calc(var(--space-6)+env(safe-area-inset-left))] text-on-surface shadow-elevation-3 transition-[translate] duration-short-4 ease-emphasized starting:translate-x-full rtl:starting:-translate-x-full">
<div class="flex flex-row items-center justify-between gap-2">
<h2 class="text-title-lg text-on-surface">Menu</h2>
<!-- the close icon button with -me-3 -->
</div>
<!-- the phone menu or the drawer -->
</div>The start sheet (admin drawer) swaps the edge and the corners: start-0 rounded-e-sheet ps-[calc(var(--space-6)+env(safe-area-inset-left))] rtl:ps-[calc(var(--space-6)+env(safe-area-inset-right))] pe-6 starting:-translate-x-full rtl:starting:translate-x-full.
React
A SideSheet on Radix Dialog (Global Jobs' menu sheet is one already):
| Prop | Type | Default | Description |
|---|---|---|---|
open |
boolean |
required | Controlled; the menu button mirrors it in [aria-expanded]. |
onOpenChange |
(open: boolean) => void |
required | Called with false on Escape, a scrim press, Close, and a chosen link. |
side |
'end' | 'start' |
'end' |
Logical edge: end for the site menu, start for the admin drawer. |
title |
string |
required | "Menu" in the page language; names the sheet. |
closeLabel |
string |
required | "Close" in the page language; the close button's name and tooltip. |
children |
ReactNode |
none | The nav sheet or the drawer. |
<SideSheet open={menuOpen} onOpenChange={setMenuOpen} side="end" title={t('menu')} closeLabel={t('close')}>
<NavSheet items={links} current={pathname} onNavigate={() => setMenuOpen(false)} />
</SideSheet>