Dark Light
System
Default LBBW Jira Confluence Source Code
Share
Playground

Drawer

<afp-drawer> Since 1.4.0 experimental This component uses the light DOM, so its markup and styles are part of the regular document flow.

A drawer component that slides in from the edge of the screen to display contextual content like filters, settings, or details without leaving the current page context.

Drawer Title

Lorem ipsum dolor sit amet, consectetur adipisicing elit. Ab accusamus aliquam asperiores atque aut, doloremque ea, eligendi fugit in minima non obcaecati odio perspiciatis porro quia, quis quod saepe! Vitae.

Close
Drawer

Examples #

Placement #

Use the placement attribute to define which edge of the screen the drawer slides in from. Supports left, right (default), top, and bottom.

Right Drawer

This drawer slides in from the right side of the screen.

Close
Left Drawer

This drawer slides in from the left side of the screen.

Close
Top Drawer

This drawer slides in from the top of the screen.

Close
Bottom Drawer

This drawer slides in from the bottom of the screen.

Close
Right Left Top Bottom

Filter Example #

A practical example of using a drawer for filters.

Filter
All Active Inactive Show archived
Reset Apply
Open Filters

Without Header #

Use the noHeader (noheader) attribute to create a drawer without the header section.

This drawer has no header. The content starts immediately.

Close
Without Header

Use the noFooter (nofooter) attribute to create a drawer without the footer section.

Without Footer

This drawer has no footer section.

Without Footer

Without Backdrop #

Use the noBackdrop attribute to show the drawer without an overlay backdrop.

No Backdrop

This drawer has no backdrop overlay, allowing interaction with the page behind.

Close
Without Backdrop

Closeable #

Set closeable to true to allow closing via ESC key or backdrop click. By default, the drawer can only be closed using the close button.

Closeable Drawer

This drawer can be closed by pressing ESC or clicking the backdrop.

Cancel Confirm
Closeable Drawer

Custom Size #

Use the --afp-drawer-size CSS custom property to customize the drawer width (for left/right) or height (for top/bottom).

Custom Size

This drawer has a custom width of 30rem.

Close
Custom Size (30rem)

Custom Animation Duration #

Use the duration attribute to customize the animation duration in milliseconds.

Slow Animation

This drawer has a slower animation (500ms).

Close
Slow Animation

Scrollable Content #

The drawer content area automatically becomes scrollable when content exceeds the available height.

Scrollable Content

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.

Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.

Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.

Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium.

Nemo enim ipsam voluptatem quia voluptas sit aspernatur aut odit aut fugit.

Neque porro quisquam est, qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit.

Close
Scrollable Content

Properties

Learn more about properties.

Name Description Reflects
open
Whether the drawer is open.
Type boolean
Default false
placement
The placement of the drawer. Determines which edge of the screen the drawer slides in from.
Type
AfpPlacement
Name Description
TOP
Top placement.
RIGHT
Right placement.
BOTTOM
Bottom placement.
LEFT
Left placement.
TOP_START
Top-start placement.
TOP_END
Top-end placement.
RIGHT_START
Right-start placement.
RIGHT_END
Right-end placement.
BOTTOM_START
Bottom-start placement.
BOTTOM_END
Bottom-end placement.
LEFT_START
Left-start placement.
LEFT_END
Left-end placement.
AfpPlacement
Default AfpPlacement.RIGHT
closeable
Allows closing by ESC key or clicking on the backdrop. When false (default), the drawer can only be closed using the close button. When true, clicking the backdrop or pressing ESC will also close the drawer.
Type boolean
Default false
noHeader
noheader
Hides the header section.
Type boolean
Default false
noFooter
nofooter
Hides the footer section.
Type boolean
Default false
noBackdrop
nobackdrop
Whether the drawer has an overlay backdrop. When false, the drawer opens without a backdrop overlay.
Type boolean
Default false
duration
Animation duration in milliseconds for show/hide transitions.
Type number
Default 200
label
The label for the drawer, used for accessibility.
Type string
Default ''

Methods

Learn more about using methods.

Name Description Arguments
show
Programmatically open the drawer.
-
hide
Programmatically close the drawer.
-

Events

Learn more about events.

Name Return Description
afp-show void
Emitted when the drawer begins to open.
afp-after-show void
Emitted after the drawer has fully opened and transitions are complete.
afp-hide void
Emitted when the drawer begins to close.
afp-after-hide void
Emitted after the drawer has fully closed and transitions are complete.

Slots

Learn more about slots.

Name Description
default
The default slot for the drawer's main content.
header
Optional slot for the drawer header content.
footer
Optional slot for the drawer footer content.
close-icon
Slot to customize the close button icon.

CSS Parts

Learn more about CSS Parts.

Name Description Selector
base
The drawer's base wrapper (the `<dialog>` element).
::part(base)
wrapper
The content wrapper inside the drawer.
::part(wrapper)
header
The header section of the drawer.
::part(header)
header-title
The title section within the header.
::part(header-title)
close-button
The close button in the header.
::part(close-button)
content
The main content section of the drawer.
::part(content)
footer
The footer section of the drawer.
::part(footer)
backdrop
The backdrop overlay behind the drawer.
::part(backdrop)

CSS Custom Properties

Name Description Default
--afp-drawer-size
The width (for left/right) or height (for top/bottom) of the drawer.
20rem
--afp-drawer-close-icon-size
The size of the close icon.
--afp-font-size-m

Dependencies

The component automatically brings in the listed items, including any nested dependencies that may exist.

afp-button afp-icon

Importing

Using the bundle is the recommended method to include components. If you’d rather handle imports manually, you can use the code examples below.

import '@afp-design-system/core/dist/components/drawer/drawer.js';
Share
Create a link with a predefined theme that is automatically applied when the generated link is opened. Default LBBW Presentation Mode
Abort Copy Link