Fractal UI Motif Fractal UI Type
On this Page

DrawerRoot

DrawerRoot is the compound Drawer root. It is an explicit alias of SheetRoot, so it owns the shared open state consumed by DrawerTrigger, DrawerContent, and DrawerClose.

Usage

Svelte
<script lang="ts">
	import { DrawerContent, DrawerRoot, DrawerTrigger } from 'fractalsvelte';

	let open = $state(false);
</script>

<DrawerRoot bind:open>
	<DrawerTrigger>Open filters</DrawerTrigger>
	<DrawerContent>Filter controls</DrawerContent>
</DrawerRoot>

API

PropTypeDefaultDescription
openbooleanfalseShared drawer state. Supports bind:open.
childrenSnippetrequiredCompound drawer content that receives this root’s context.

Use DrawerTrigger to open the nearest root, DrawerContent for the modal surface, and DrawerClose to close it.