{% extends "base.html" %} {% import "components/macros.html" as ui %} {% block title %}Slide-over Drawers (Sheets) - Design System Wiki{% endblock %} {% block content %}
{% include "docs/sidebar.html" %}
Overlays

Slide-over Drawers (Sheets)

Right-anchored slide-out sheets designed for detail inspections, metadata lists, settings panels, and form workflows.

Drawer Showcase & Integration

{{ ui::sheet_trigger(target_id="wiki-demo-sheet", label="Open Right Drawer", variant="indigo") }}

How the Global Sheet JS Works

The global script components.js monitors specific attributes and classes on page load. Here is the operational contract for sheets:

Selector / Class Type Behavior & Purpose
[data-sheet-target] Attribute Applied to buttons or triggers. The value must match the ID of the sheet container (e.g., data-sheet-target="my-sheet"). Clicking it triggers openSheet("my-sheet").
.sheet-dialog Class The outer wrapper sheet container. Starts with the class hidden. Toggled by the script.
.sheet-content Class The inner slide-over panel card. The JS toggles transition translation classes (removes translate-x-full and adds translate-x-0 on show).
.sheet-backdrop Class The backdrop overlay. The JS toggles its opacity and registers clicks on it to automatically close the sheet.
.sheet-close Class Applied to close trigger buttons. Clicking any element with this class closes the sheet.
💡 What is customizable?

You can freely style the placement, width, colors, borders, and contents of the .sheet-content slide-out panel. The functional slide classes (translate-x-full and translate-x-0) and semantic structure class names must be preserved so the script can locate and slide the sheets dynamically.

Confirmation Actions (e.g., Deletes)

Slide-over sheets are highly effective for confirmation dialogs when you want to provide more context, metadata details, or descriptive warnings about the entity being impacted before executing the action.

Demo Database Entity:
User Account: ahmed_shaamil {{ ui::sheet_trigger(target_id="wiki-confirm-delete-sheet", label="Delete User", variant="destructive", extra_class="!px-2.5 !py-1 text-[10px]") }}
{{ ui::sheet_open(id="wiki-demo-sheet", title="Drawer Panel Properties", max_width_class="max-w-sm") }}

This slide-over panel demonstrates real-time sidebar parameter adjustments, sliding in from the right edge with hardware transitions.

{{ ui::sheet_close(save_label="Save Properties") }} {{ ui::sheet_open(id="wiki-confirm-delete-sheet", title="Confirm Account Deletion", max_width_class="max-w-sm") }}

Are you sure you want to permanently delete user ahmed_shaamil? All database records and linked files will be removed.

{% endblock %}