Skip to main content
Svelte Drawer exports TypeScript types for all component props, enabling type-safe usage and better IDE autocomplete support.

Importing types

Type definitions

DrawerProps

Props for the main Drawer component.
Use when: Defining props for the root Drawer component or creating wrapper components. Example:

DrawerContentProps

Props for the DrawerContent component.
Use when: Customizing the drawer content container with focus trapping and styling. Example:

DrawerOverlayProps

Props for the DrawerOverlay component.
Use when: Customizing the backdrop overlay appearance and blur effects. Example:

DrawerHandleProps

Props for the DrawerHandle component.
Use when: Adding a drag handle indicator to your drawer. Example:

DrawerVariant

Union type for predefined drawer style variants.
Use when: Specifying a variant for the DrawerVariants component or creating type-safe variant selection. Example:

DrawerVariantsProps

Props for the DrawerVariants component.
Use when: Using the variants component with predefined styles. Example:

DrawerPortalProps

Props for the DrawerPortal component.
Use when: Manually controlling where the drawer is rendered in the DOM. Example:

DrawerHeaderProps

Props for the DrawerHeader component.
Use when: Adding a styled header section with title, description, and close button. Example:

DrawerFooterProps

Props for the DrawerFooter component.
Use when: Adding a styled footer section to your drawer. Example:

Creating typed wrappers

You can use these types to create strongly-typed wrapper components: