{"slug":"sheet","name":"Sheet","category":"Overlays","summary":"A panel that slides in from an edge for secondary flows.","status":"stable","since":"0.1.0","import":"import { Sheet } from '@elluzion/iv-ui';","usage":["`side` chooses the edge; `size` sets the width, or the height for top and bottom sheets.","Bind `open`; the component closes itself and calls `onclose` when dismissed.","Use for filters, details, or compact forms; use `Dialog` for a decision."],"props":[{"name":"open","type":"boolean","default":"false","description":"Whether the sheet is visible. Bind with `bind:open`.","required":true,"bindable":true},{"name":"side","type":"SheetSide","default":"'bottom'","description":"Edge the sheet slides in from.","required":false,"bindable":false},{"name":"size","type":"SheetSize","default":"'md'","description":"Sheet width (or height for top/bottom sheets).","required":false,"bindable":false},{"name":"title","type":"string","default":"''","description":"Sheet title; also used as the accessible name.","required":false,"bindable":false},{"name":"closeOnBackdrop","type":"boolean","default":"true","description":"Closes when the backdrop is clicked.","required":false,"bindable":false},{"name":"closeOnEscape","type":"boolean","default":"true","description":"Closes on Escape.","required":false,"bindable":false},{"name":"showCloseButton","type":"boolean","default":"true","description":"Shows the header close button.","required":false,"bindable":false},{"name":"className","type":"string","default":"''","description":"Extra classes merged onto the root element.","required":false,"bindable":false}],"events":[{"name":"close","type":"() => void","default":null,"description":"Called when the sheet requests to close; set `open = false` in response.","required":false,"bindable":false}],"snippets":[{"name":"children","type":"Snippet","default":null,"description":"Content rendered inside the component.","required":true,"bindable":false},{"name":"icon","type":"Snippet","default":null,"description":"Icon rendered before the title.","required":false,"bindable":false},{"name":"footer","type":"Snippet","default":null,"description":"Actions rendered below the body.","required":false,"bindable":false}],"types":[{"name":"SheetSide","kind":"type","code":"type SheetSide = 'left' | 'right' | 'top' | 'bottom';","description":"Edge the sheet slides in from."},{"name":"SheetSize","kind":"type","code":"type SheetSize = 'sm' | 'md' | 'lg' | 'full';","description":"Sheet width or height step."}],"manual":[],"tokens":["--iv_blur","--iv_border","--iv_ease-in-out","--iv_font-sans","--iv_foreground","--iv_foreground-dim","--iv_overlay","--iv_radius-lg","--iv_radius-sm","--iv_ring","--iv_ring-width","--iv_shadow-lg","--iv_sheet-lg","--iv_sheet-md","--iv_sheet-sm","--iv_spacing-2xl","--iv_spacing-lg","--iv_spacing-md","--iv_spacing-sm","--iv_spacing-xl","--iv_surface-raised","--iv_text-xl","--iv_transition-base","--iv_z-overlay"],"cssHooks":["iv-backdrop","iv-body","iv-body-no-title","iv-close-btn","iv-footer","iv-header","iv-icon-slot","iv-sheet","iv-sheet-full","iv-sheet-lg","iv-sheet-sm","iv-side-bottom","iv-side-left","iv-side-right","iv-side-top","iv-title-area"],"accessibility":{"keyboard":[["Tab","Cycles focus inside the sheet."],["Escape","Closes the sheet unless `closeOnEscape` is false."]],"notes":["The surface uses `role=\"dialog\"` and `aria-modal=\"true\"`.","The title names the sheet; the body is linked through `aria-describedby`.","Focus is trapped while open and restored on close."]},"related":[{"title":"Dialog","summary":"A modal surface for focused tasks and confirmations.","url":"/components/dialog","kind":"Component"},{"title":"AlertDialog","summary":"A blocking confirmation that returns a decision through an action.","url":"/components/alert-dialog","kind":"Component"},{"title":"Popover","summary":"A floating panel anchored to an element.","url":"/components/popover","kind":"Component"},{"title":"Card","summary":"A bordered surface for grouped content and actions.","url":"/components/card","kind":"Component"}],"examples":[{"id":"sides","title":"Sides","description":"One sheet that slides in from any of the four edges.","code":"<script lang=\"ts\">\n\timport type { SheetSide } from '@elluzion/iv-ui';\n\timport { Button, Sheet } from '@elluzion/iv-ui';\n\n\tlet open = $state(false);\n\tlet side = $state<SheetSide>('right');\n</script>\n\n<div class=\"stack\">\n\t<div class=\"row\">\n\t\t{#each ['left', 'right', 'top', 'bottom'] as edge (edge)}\n\t\t\t<Button\n\t\t\t\tsize=\"sm\"\n\t\t\t\tvariant=\"outline\"\n\t\t\t\tonclick={() => {\n\t\t\t\t\tside = edge as SheetSide;\n\t\t\t\t\topen = true;\n\t\t\t\t}}>{edge}</Button\n\t\t\t>\n\t\t{/each}\n\t</div>\n\t<Sheet bind:open {side} title=\"Sheet from the {side}\">\n\t\t<p class=\"body\">The panel slides in from the chosen edge and traps focus until it closes.</p>\n\t</Sheet>\n</div>\n\n<style>\n\t.stack {\n\t\tdisplay: flex;\n\t\tflex-direction: column;\n\t\talign-items: center;\n\t\tgap: var(--iv_spacing-md);\n\t}\n\n\t.row {\n\t\tdisplay: flex;\n\t\tflex-wrap: wrap;\n\t\tjustify-content: center;\n\t\tgap: var(--iv_spacing-sm);\n\t}\n\n\t.body {\n\t\tmargin: 0;\n\t\tcolor: var(--iv_foreground-dim);\n\t\tfont-size: var(--iv_text-body);\n\t}\n</style>"},{"id":"sizes","title":"Sizes","description":"`sm`, `md`, `lg`, and `full` width steps.","code":"<script lang=\"ts\">\n\timport type { SheetSize } from '@elluzion/iv-ui';\n\timport { Button, Sheet } from '@elluzion/iv-ui';\n\n\tlet open = $state(false);\n\tlet size = $state<SheetSize>('md');\n</script>\n\n<div class=\"stack\">\n\t<div class=\"row\">\n\t\t{#each ['sm', 'md', 'lg', 'full'] as step (step)}\n\t\t\t<Button\n\t\t\t\tsize=\"sm\"\n\t\t\t\tvariant={size === step ? 'primary' : 'outline'}\n\t\t\t\tonclick={() => {\n\t\t\t\t\tsize = step as SheetSize;\n\t\t\t\t\topen = true;\n\t\t\t\t}}>{step}</Button\n\t\t\t>\n\t\t{/each}\n\t</div>\n\t<Sheet bind:open {size} title=\"Size {size}\" side=\"right\">\n\t\t<p class=\"body\">Width is capped by the size step; full takes the whole viewport.</p>\n\t</Sheet>\n</div>\n\n<style>\n\t.stack {\n\t\tdisplay: flex;\n\t\tflex-direction: column;\n\t\talign-items: center;\n\t\tgap: var(--iv_spacing-md);\n\t}\n\n\t.row {\n\t\tdisplay: flex;\n\t\tflex-wrap: wrap;\n\t\tjustify-content: center;\n\t\tgap: var(--iv_spacing-sm);\n\t}\n\n\t.body {\n\t\tmargin: 0;\n\t\tcolor: var(--iv_foreground-dim);\n\t\tfont-size: var(--iv_text-body);\n\t}\n</style>"},{"id":"footer","title":"Footer","description":"A sticky footer keeps the actions in reach.","code":"<script lang=\"ts\">\n\timport { Button, Field, Input, Sheet } from '@elluzion/iv-ui';\n\n\tlet open = $state(false);\n\tlet name = $state('Orbital');\n\tlet saved = $state(false);\n</script>\n\n<div class=\"stack\">\n\t<Button onclick={() => (open = true)}>Edit workspace</Button>\n\t<Sheet bind:open title=\"Workspace\" side=\"right\">\n\t\t<Field label=\"Name\" htmlFor=\"sheet-name\">\n\t\t\t<Input id=\"sheet-name\" bind:value={name} />\n\t\t</Field>\n\t\t{#snippet footer()}\n\t\t\t<Button variant=\"ghost\" onclick={() => (open = false)}>Cancel</Button>\n\t\t\t<Button\n\t\t\t\tvariant=\"primary\"\n\t\t\t\tonclick={() => {\n\t\t\t\t\topen = false;\n\t\t\t\t\tsaved = true;\n\t\t\t\t}}>Save</Button\n\t\t\t>\n\t\t{/snippet}\n\t</Sheet>\n\t{#if saved}<p class=\"readout\">saved {name}</p>{/if}\n</div>\n\n<style>\n\t.stack {\n\t\tdisplay: flex;\n\t\tflex-direction: column;\n\t\talign-items: center;\n\t\tgap: var(--iv_spacing-sm);\n\t}\n\n\t.readout {\n\t\tmargin: 0;\n\t\tfont-family: var(--iv_font-mono);\n\t\tfont-size: var(--iv_text-sm);\n\t\tcolor: var(--iv_success);\n\t}\n</style>"}],"markdown":"/components/sheet.md","page":"/components/sheet"}