# Sidebar · semantische Komponentenreferenz

Compose labelled application navigation with a desktop expanded/collapsed state and an independently controlled mobile Sheet.

Status der neuen Domänenmigration: **complete** im begrenzten Referenzumfang. Stabile Teile, tatsächlich passende Source-Selektoren, semantische Tokenwerte und nutzbare Zustands-Fixtures wurden mit dem normalen Komponentenprüfpfad und der echten React-Verwendung geprüft. [Browsernachweis](../../validation/semantic-layers-browser-run.json); keine allgemeine Anwendungsfreigabe.

SidebarProvider has a real wrapper and separate desktop/mobile state; useSidebar is context, not DOM. Desktop source widths 16rem/3rem are bound through the public style override to semantic tokens; native 255px inner+border and 48px collapsed examples remain evidence. Mobile uses source 18rem preferred Sheet width capped to viewport clearance; its data-slot is sidebar, so generic SheetContent slot rules alone do not style it. Source hardcoded hidden default Close is retained and target supplies a real visible SheetClose inside navigation content. Desktop physical left/right container, gap, icon/offcanvas state and mobile modal ownership remain distinct. Pinned Sidebar consumes dir but forwards it only to mobile SheetContent; the reference keeps the provider layout LTR for physical gap order and explicitly sets dir on Header/Content/Footer/Inset text regions. Right desktop inner border faces content. Native menu 8px corner role is retained;32/28/48 button sizes, group inset/captions, badges/actions/submenus and skeleton geometry are explicit bounded reference roles. Collapsed labels may be visually hidden only when each icon link has a persistent aria-label; optional Tooltip is supplementary, not sole naming. The reference composes Rail only on desktop; mobile has real Trigger/Close controls. Source Shortcut Ctrl/Meta+B still intercepts even editable descendants; preventDefault on SidebarTrigger callback does not cancel its subsequent internal toggle. Controlled desktop callback can be ignored while source cookie still records the requested state; no new cancellable event is invented. Mobile open state is independent, and the source 767px breakpoint is retained. Source variants/API stay in CEM/UX; no fixed native page height/position or source-id anatomy remains.

[Stabile Anatomie und tatsächliche Source-/Caller-Bindungen](component.json), [CEM](interface.json), [semantische Zustands-/Variantenregeln](layout.css), [brauchbare Fixtures](stories.json). Native Muster, Hashes und Messwerte bleiben vollständig separat in [Quellmustern](figma/source-specimens.json) und [Traceability](figma/traceability.json).

Die veröffentlichten Props/Callbacks und der [führende SCXML-Aktor](behavior.scxml) bleiben die Quelle des tatsächlichen Verhaltens. [HTML/ARIA](accessibility.html) und [Projektionsregeln](accessibility.rules.json) benennen die konkrete Verwendung, einschließlich notwendiger Caller-Beschriftung. Selectorbindungen sind ein expliziter React-/DOM-Adaptervertrag, keine erfundenen automatischen Shadow-DOM-Exports.

All exported Sidebar parts are preserved. SidebarProvider defaults defaultOpen=true and supplies desktop open/state, openMobile, isMobile, setOpen/setOpenMobile and toggleSidebar through useSidebar; Sidebar itself accepts side left|right, variant sidebar|floating|inset and collapsible offcanvas|icon|none. Desktop widths are16rem, icon3rem, mobile18rem. The pinned use-mobile hook is false during SSR/initial render and tracks window.innerWidth<768 using matchMedia afterward. Desktop openProp and onOpenChange should be supplied as a pair: setOpen calls the handler instead of internal state whenever a handler exists, even without an openProp. The callback is boolean-only, not cancellable eventDetails. Every desktop setOpen request writes sidebar_state=true|false, path=/, max-age604800; the provider does not read that cookie automatically, and a rejected/ignored controlled request can still write its candidate. Mobile toggle only changes openMobile, with no desktop onOpenChange or cookie write. The two states are not synchronized/reset on breakpoint changes. collapsible=none bypasses responsive Sheet/collapse rendering even though provider state can still change. Trigger calls caller onClick then always toggles (defaultPrevented is not a veto); Rail is native button tabindex=-1 and needs explicit type=button in a form-safe reference. Provider always registers lowercase Ctrl/Meta+b globally while mounted, including editable targets; there is no disable-shortcut prop, so this reference uses one provider and documents that application constraint. SidebarInset is main; avoid nested main landmarks. Header/Footer/Group/Content are containers, Menu/Sub are native lists, and MenuButton defaults button via useRender: actual navigation deliberately renders anchors. isActive only supplies appearance/data-active, not aria-current; caller supplies current-page semantics. GroupLabel requires caller heading choice. Skeleton has random50–89% width and no loading announcement; use the completed Skeleton usage policy. Optional tooltip is visual-only and shown collapsed desktop, so native names remain complete. Mobile Sidebar composes Sheet with fixed title Sidebar/description Displays the mobile sidebar and hides its direct default Close button in source CSS; this reference supplies an explicit nested Close navigation control. Desktop icon collapse is chosen to keep intended navigation available; offcanvas CSS alone does not supply an inert/focus-removal guarantee.

Native Trigger Enter/Space and registered Ctrl/Meta+b toggle the appropriate viewport state. Desktop collapse does not become a dialog or trap focus. Mobile uses the real Sheet/Dialog focus, Escape and restoration policy; its trigger aria-expanded uses openMobile, not the desktop state. Navigation links retain native Tab/Enter and readable names when icon-collapsed. Rail is an optional pointer duplicate, not the sole keyboard access. Names, landmark label, heading and active-page relation are explicit caller composition.

[Originale React-Quellen und Versionen](../../sources/manifest.json), [nativer FIG-/PNG-Beleg](figma/figma-observations.json) und [tatsächliches Source-Prüfziel](provenance://source/apps%2Fshadcn-reference-lab%2FREADME.md). `release:false`; kein allgemeines Pixel-/Framework-/AT-Zertifikat.
