Components / Surfaces
Sheet
Extends the dialog shell to the side or edge of the screen.
<button type="button" class="btn" data-variant="outline">
Open sheet
</button>
<dialog class="sheet" id="demo-sheet-default" data-side="inline-end" aria-labelledby="sheet-default-title" aria-describedby="sheet-default-description">
<div>
<header>
<h2 data-slot="title" id="sheet-default-title">Edit profile</h2>
<p data-slot="description" id="sheet-default-description">Make changes to your profile here. Click save when you're done.</p>
</header>
<section>
<div class="fieldset">
<div class="field">
<label class="label" for="sheet-default-name">Name</label>
<input class="input" id="sheet-default-name" value="Ada Lovelace">
</div>
<div class="field">
<label class="label" for="sheet-default-username">Username</label>
<input class="input" id="sheet-default-username" value="@ada">
</div>
</div>
</section>
<footer>
<button type="button" class="btn" data-variant="outline">Cancel</button>
<button type="button" class="btn">Save changes</button>
</footer>
<form method="dialog">
<button class="btn" data-variant="ghost" data-size="icon-sm" aria-label="Close"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M18 6 6 18"/><path d="m6 6 12 12"/></svg></button>
</form>
</div>
</dialog>Installation
pnpm dlx loseta add sheetnpx loseta add sheetExamples
Sides
<div style="display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 0.5rem">
<button type="button" class="btn" data-variant="outline" data-size="sm">Top</button>
<button type="button" class="btn" data-variant="outline" data-size="sm">Right</button>
<button type="button" class="btn" data-variant="outline" data-size="sm">Bottom</button>
<button type="button" class="btn" data-variant="outline" data-size="sm">Left</button>
</div>
<dialog class="sheet" id="demo-sheet-side-top" data-side="block-start" aria-labelledby="sheet-side-top-title">
<div>
<header>
<h2 data-slot="title" id="sheet-side-top-title">Top sheet</h2>
<p data-slot="description">Anchored to the block start edge.</p>
</header>
<section>
<p>Use a top sheet for a short announcement or a wide filter bar.</p>
</section>
<footer>
<button type="button" class="btn" data-variant="outline">Close</button>
</footer>
<form method="dialog">
<button class="btn" data-variant="ghost" data-size="icon-sm" aria-label="Close top sheet"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M18 6 6 18"/><path d="m6 6 12 12"/></svg></button>
</form>
</div>
</dialog>
<dialog class="sheet" id="demo-sheet-side-right" data-side="inline-end" aria-labelledby="sheet-side-right-title">
<div>
<header>
<h2 data-slot="title" id="sheet-side-right-title">Right sheet</h2>
<p data-slot="description">Anchored to the inline end edge.</p>
</header>
<section>
<p>Use a side sheet for details that complement the page.</p>
</section>
<footer>
<button type="button" class="btn" data-variant="outline">Close</button>
</footer>
<form method="dialog">
<button class="btn" data-variant="ghost" data-size="icon-sm" aria-label="Close right sheet"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M18 6 6 18"/><path d="m6 6 12 12"/></svg></button>
</form>
</div>
</dialog>
<dialog class="sheet" id="demo-sheet-side-bottom" data-side="block-end" aria-labelledby="sheet-side-bottom-title">
<div>
<header>
<h2 data-slot="title" id="sheet-side-bottom-title">Bottom sheet</h2>
<p data-slot="description">Anchored to the block end edge.</p>
</header>
<section>
<p>Use a bottom sheet for actions that relate to the current view.</p>
</section>
<footer>
<button type="button" class="btn" data-variant="outline">Close</button>
</footer>
<form method="dialog">
<button class="btn" data-variant="ghost" data-size="icon-sm" aria-label="Close bottom sheet"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M18 6 6 18"/><path d="m6 6 12 12"/></svg></button>
</form>
</div>
</dialog>
<dialog class="sheet" id="demo-sheet-side-left" data-side="inline-start" aria-labelledby="sheet-side-left-title">
<div>
<header>
<h2 data-slot="title" id="sheet-side-left-title">Left sheet</h2>
<p data-slot="description">Anchored to the inline start edge.</p>
</header>
<section>
<p>Use a left sheet for navigation or secondary controls.</p>
</section>
<footer>
<button type="button" class="btn" data-variant="outline">Close</button>
</footer>
<form method="dialog">
<button class="btn" data-variant="ghost" data-size="icon-sm" aria-label="Close left sheet"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M18 6 6 18"/><path d="m6 6 12 12"/></svg></button>
</form>
</div>
</dialog>No close button
<button type="button" class="btn" data-variant="outline">
Open sheet without close
</button>
<dialog class="sheet" id="demo-sheet-no-close" data-side="inline-end" aria-labelledby="sheet-no-close-title" aria-describedby="sheet-no-close-description">
<div>
<header>
<h2 data-slot="title" id="sheet-no-close-title">No close button</h2>
<p data-slot="description" id="sheet-no-close-description">This sheet has no close control in the corner. Dismiss it with Escape or the footer action.</p>
</header>
<section>
<p>Omit the close form when the footer already provides a clear exit.</p>
</section>
<footer>
<button type="button" class="btn">Close</button>
</footer>
</div>
</dialog>Scrollable content
<button type="button" class="btn" data-variant="outline">
Open scrollable sheet
</button>
<dialog class="sheet" id="demo-sheet-scrollable" data-side="inline-end" aria-labelledby="sheet-scrollable-title" aria-describedby="sheet-scrollable-description">
<div>
<header>
<h2 data-slot="title" id="sheet-scrollable-title">Scrollable content</h2>
<p data-slot="description" id="sheet-scrollable-description">The header and footer stay in place while the section scrolls.</p>
</header>
<section role="region" aria-label="Scrollable sheet content" tabindex="0">
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.</p>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.</p>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.</p>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.</p>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.</p>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.</p>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.</p>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.</p>
</section>
<footer>
<button type="button" class="btn" data-variant="outline">Close</button>
</footer>
<form method="dialog">
<button class="btn" data-variant="ghost" data-size="icon-sm" aria-label="Close scrollable sheet"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M18 6 6 18"/><path d="m6 6 12 12"/></svg></button>
</form>
</div>
</dialog>Left, small
<button type="button" class="btn" data-variant="outline">
Open left sheet
</button>
<dialog class="sheet" id="demo-sheet-left" data-side="inline-start" data-size="sm" aria-labelledby="sheet-left-title">
<div>
<header>
<h2 data-slot="title" id="sheet-left-title">Navigation</h2>
</header>
<section>
<p>Use the left sheet for navigation or secondary controls.</p>
</section>
<footer>
<button type="button" class="btn" data-variant="outline">Close</button>
</footer>
<form method="dialog">
<button class="btn" data-variant="ghost" data-size="icon-sm" aria-label="Close left sheet"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M18 6 6 18"/><path d="m6 6 12 12"/></svg></button>
</form>
</div>
</dialog>Large
<button type="button" class="btn" data-variant="outline">
Open large sheet
</button>
<dialog class="sheet" id="demo-sheet-large" data-side="inline-end" data-size="lg" aria-labelledby="sheet-large-title" aria-describedby="sheet-large-description">
<div>
<header>
<h2 data-slot="title" id="sheet-large-title">Filters</h2>
<p data-slot="description" id="sheet-large-description">Narrow the results to the records you need.</p>
</header>
<section>
<div class="field">
<label class="label" for="sheet-large-query">Search</label>
<input class="input" id="sheet-large-query" placeholder="Name, owner or status">
</div>
</section>
<footer>
<button type="button" class="btn" data-variant="outline">Reset</button>
<button type="button" class="btn">Apply</button>
</footer>
<form method="dialog">
<button class="btn" data-variant="ghost" data-size="icon-sm" aria-label="Close large sheet"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M18 6 6 18"/><path d="m6 6 12 12"/></svg></button>
</form>
</div>
</dialog>Right-to-left
<div dir="rtl" lang="ar">
<button type="button" class="btn" data-variant="outline">
فتح اللوحة
</button>
<dialog class="sheet" id="demo-sheet-rtl" data-side="inline-end" aria-labelledby="sheet-rtl-title" aria-describedby="sheet-rtl-description">
<div>
<header>
<h2 data-slot="title" id="sheet-rtl-title">تعديل الملف الشخصي</h2>
<p data-slot="description" id="sheet-rtl-description">أجرِ تغييرات على ملفك الشخصي هنا.</p>
</header>
<section>
<div class="field">
<label class="label" for="sheet-rtl-name">الاسم</label>
<input class="input" id="sheet-rtl-name" value="ليلى حسن">
</div>
</section>
<footer>
<button type="button" class="btn" data-variant="outline">إلغاء</button>
<button type="button" class="btn">حفظ التغييرات</button>
</footer>
<form method="dialog">
<button class="btn" data-variant="ghost" data-size="icon-sm" aria-label="إغلاق"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M18 6 6 18"/><path d="m6 6 12 12"/></svg></button>
</form>
</div>
</dialog>
</div>Accessibility and behavior
- Native <dialog> with data-side="inline-start|inline-end" for side sheets or "block-start|block-end" for top and bottom sheets. CSS only handles presentation; call showModal() and close(). Use header/section/footer inside the panel. data-size sm/default/lg changes the width, or the height on a top or bottom sheet. The optional close control is a direct child form[method="dialog"] wrapping an icon .btn; give it an accessible label. A section scrolls between the header and footer.
Files
components/sheet.cssbasestyles/nova/sheet.cssstyleInstall contract
The CLI writes the base file under components/, the visual file for the selected style under styles/<name>/, and any primitive dependency underprimitives/. The generated index.css imports them in the right layer order.