Skip to content
Glint UI

Sheet

A side-anchored panel that slides out from any screen edge to present complementary content or forms.

Usage

import { Sheet, SheetSide } from "@glint/components/sheet.slint";
export component AppWindow inherits Window {
in-out property <bool> show-filters: false;
callback apply-filters();
VerticalLayout {
// your screen layout
}
// Last child of the window, sized to it: Slint has no portals, so what
// draws on top is what comes last.
Sheet {
width: parent.width;
height: parent.height;
side: SheetSide.right;
open <=> root.show-filters;
title: "Filters";
description: "Narrow down the search results.";
dismissed => { root.apply-filters(); }
}
}

A Sheet is a side-anchored drawer that slides into view over the current window. Its body content goes between the braces via the @children slot, placed between the header block and the bottom of the panel.

Mount it last among the window’s children, sized to width: parent.width; height: parent.height.

Examples

Sides

side attaches the sheet to any edge of the window: right (the default), left, top, or bottom. The slide animation automatically follows the chosen edge.

Custom panel extent

panel-extent sets the cross-axis dimension of the sheet: width for left/right sheets (default 360px) or height for top/bottom sheets.

Backdrop dismissal

By default, clicking the scrim backdrop closes the sheet. Set dismiss-on-backdrop: false when the reader must explicitly use the close button or press Escape.

Restoring focus

restore-focus fires whenever the sheet closes, returning keyboard focus to the trigger element.

API Reference

Properties

PropertyTypeDefaultDescription
openin-out boolfalseTwo-way; consumer sets true to slide in, Glint sets false on close.
sidein SheetSideSheetSide.rightEdge to attach to — top, right, bottom, left.
titlein stringno defaultHeading inside the sheet.
descriptionin stringno defaultBody text under the title.
close-labelin string@tr("Close")Accessible label for the panel's close control.
show-close-buttonin booltrueWhether the panel carries its top-right close control.
dismiss-on-backdropin booltrueWhen true, clicking outside the sheet closes it.
panel-extentin length360pxCross-axis dimension of the panel: width for left/right, height for top/bottom.

Callbacks

CallbackDescription
dismissed()Fired when the sheet closes itself — backdrop, Escape or the close control.
restore-focus()Fired on EVERY close, including one the consumer drives by setting open = false, so keyboard focus always gets a new home: restore-focus => { my-button.focus(); }. Slint exposes no "previously focused element", so only the trigger's owner can name it. Same contract Drawer, Dialog and AlertDialog publish.

Enums

EnumValues
SheetSidetop, right, bottom, left

Accessibility

  • Role and name. The open sheet card claims a region landmark named by title and described by description.
  • Keyboard navigation. While open, keyboard events land in the sheet overlay so Escape immediately dismisses the panel and fires dismissed().
  • Focus restoration. Every close path — backdrop, Escape, close button, or setting open = false — fires restore-focus() to hand focus back to the opening trigger.
  • Off-screen tree presence. When dismissed, the panel leaves the accessibility tree only when its slide-out motion completes and it has physically exited the window viewport.
  • Close button. The corner close button is announced using close-label (defaulting to @tr("Close")). It can be hidden with show-close-button: false.
  • The trigger. Controls that open a sheet should declare haspopup: true.