YuhuanStudioYunUIDocs
Overlays

Sheet

Mobile-only panel that slides in from the right over a backdrop (hidden on lg+).

A mobile-only panel that slides in from the right over a backdrop (hidden on lg screens and up). It's a controlled YunUI overlay: drive it with open + onClose. It renders an optional header title and close button, locks body scroll, and closes on backdrop click or the Escape key.

Import

tsx1 line
import { Sheet } from "@yuhuanowo/yunui";

Basic

A Sheet is fully controlled: keep its open in state and pass onClose to dismiss it. Because it only shows below the lg breakpoint, narrow your viewport to see it slide in.

Slide-in sheet

tsx20 linesScroll horizontally
"use client";

import { useState } from "react";
import { Sheet, Button } from "@yuhuanowo/yunui";

export function SheetDemo() {
const [open, setOpen] = useState(false);
return (

Props

PropTypeDefaultDescription
closeLabelstring—Accessible name for the close button. The library ships no copy of its own; the English default only keeps it usable untranslated.
mobileOnlybooleanfalseHide on large screens (`lg`+) — for mobile-only drawers (e.g. a sidebar that's permanent on desktop).
onClose*() => void—Called when the sheet should close (backdrop click, escape, close button).
open*boolean—Whether the sheet is open (controlled).
titlestring—Optional header title.

On this page