--- ## SidebarLayout App-shell layout that wires a `` to a main content region and an optional mobile header. Use this whenever you want a permanent sidebar on desktop with a hamburger overlay on mobile — it resolves the CSS-variable scoping so the main content offset works without boilerplate. The component renders the sidebar internally; consumers configure it via `sidebarHeader`, `sidebar`, and `sidebarFooter` snippets and bind `open` for the mobile overlay (or for collapsible mode at all viewports). For non-shell sidebars (right-side detail panels, drawers inside a page), keep using the `` primitive directly. **Import:** `import { SidebarLayout } from '@urbicon-ui/blocks';` ### Examples ```svelte {#snippet sidebarHeader()} My App {/snippet} {#snippet sidebar()} {/snippet} {#snippet mobileHeader({ openSidebar })} My App {/snippet}

Page content

``` ```svelte {#snippet sidebarHeader()}App{/snippet} {#snippet sidebar()}{/snippet} ``` ### Variants - contentMaxWidth: 2xl, lg, md, none, sm, xl (default: xl) - side: left, right (default: left) ### Api | Prop | Type | Required | Default | Description | | --- | --- | :---: | --- | --- | | ...HTMLAttributes | `HTMLAttributes` | no | | HTML attributes (excluding: 'children') | | children | `Snippet` | no | | Page content rendered inside the centered main column. | | class | `string` | no | | Additional CSS classes applied to the root wrapper. | | closeOnBackdropClick | `boolean` | no | true | Close the mobile sidebar overlay when clicking the backdrop. | | closeOnEscape | `boolean` | no | true | Close the mobile sidebar overlay when pressing Escape. | | contentMaxWidth | `SidebarLayoutVariants['contentMaxWidth']` | no | 'xl' | Maximum width of the centered content column. | | mobileHeader | `Snippet<[MobileHeaderContext]>` | no | | Mobile header bar, hidden on desktop in `responsive` mode. Receives a helper to open the sidebar so a hamburger button needs no extra wiring. If omitted, no mobile header is rendered. | | mode | `'responsive' | 'collapsible'` | no | 'responsive' | Sidebar mode. - `responsive` (default): permanent on desktop (≥1024px), slide-in overlay on mobile. - `collapsible`: toggleable at all viewports — width animation on desktop, overlay on mobile. | | onOpenChange | `(open: boolean) => void` | no | | Fires when the sidebar open state changes. | | open | `boolean` | no | false | Sidebar visibility. In `responsive` mode this only affects the mobile overlay. In `collapsible` mode it controls visibility at all viewports. Supports `bind:open`. | | preset | `string` | no | | Apply a named preset registered via ``. Use this to share a branded shell look across the app instead of repeating class overrides. | | side | `SidebarLayoutVariants['side']` | no | 'left' | Which edge the sidebar attaches to. | | sidebar | `Snippet` | no | | Sidebar main content — typically a `