Pages are now available as full-screen example templates that showcase real-world use cases and best practices for composing interfaces with the aFP Design System.
<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
<afp-drawerid="basicDrawer"><divslot="header">Drawer Title</div><p>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.</p><divslot="footer"><afp-buttondata-drawer="close">Close</afp-button></div></afp-drawer><afp-buttononclick="basicDrawer.show()">Drawer</afp-button>
<afp-drawer[id]="'basicDrawer'"><divslot="header">Drawer Title</div><p>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.</p><divslot="footer"><afp-button[data-drawer]="'close'">Close</afp-button></div></afp-drawer><afp-button[onclick]="'basicDrawer.show()'">Drawer</afp-button>
<AfpDrawerid="basicDrawer"><divslot="header">Drawer Title</div><p>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.</p><divslot="footer"><AfpButtondata-drawer="close">Close</AfpButton></div></AfpDrawer><AfpButtononclick="basicDrawer.show()">Drawer</AfpButton>
<AfpDrawer:id="'basicDrawer'"><divslot="header">Drawer Title</div><p>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.</p><divslot="footer"><AfpButton:data-drawer="'close'">Close</AfpButton></div></AfpDrawer><AfpButton:onclick="'basicDrawer.show()'">Drawer</AfpButton>
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
RightLeftTopBottom
<afp-drawerid="drawerRight"placement="right"><divslot="header">Right Drawer</div><p>This drawer slides in from the right side of the screen.</p><divslot="footer"><afp-buttondata-drawer="close">Close</afp-button></div></afp-drawer><afp-drawerid="drawerLeft"placement="left"><divslot="header">Left Drawer</div><p>This drawer slides in from the left side of the screen.</p><divslot="footer"><afp-buttondata-drawer="close">Close</afp-button></div></afp-drawer><afp-drawerid="drawerTop"placement="top"><divslot="header">Top Drawer</div><p>This drawer slides in from the top of the screen.</p><divslot="footer"><afp-buttondata-drawer="close">Close</afp-button></div></afp-drawer><afp-drawerid="drawerBottom"placement="bottom"><divslot="header">Bottom Drawer</div><p>This drawer slides in from the bottom of the screen.</p><divslot="footer"><afp-buttondata-drawer="close">Close</afp-button></div></afp-drawer><divclass="afp-cluster"><afp-buttononclick="drawerRight.show()"> Right</afp-button><afp-buttononclick="drawerLeft.show()">Left</afp-button><afp-buttononclick="drawerTop.show()">Top</afp-button><afp-buttononclick="drawerBottom.show()">Bottom</afp-button></div>
<afp-drawer[id]="'drawerRight'"[placement]="'right'"><divslot="header">Right Drawer</div><p>This drawer slides in from the right side of the screen.</p><divslot="footer"><afp-button[data-drawer]="'close'">Close</afp-button></div></afp-drawer><afp-drawer[id]="'drawerLeft'"[placement]="'left'"><divslot="header">Left Drawer</div><p>This drawer slides in from the left side of the screen.</p><divslot="footer"><afp-button[data-drawer]="'close'">Close</afp-button></div></afp-drawer><afp-drawer[id]="'drawerTop'"[placement]="'top'"><divslot="header">Top Drawer</div><p>This drawer slides in from the top of the screen.</p><divslot="footer"><afp-button[data-drawer]="'close'">Close</afp-button></div></afp-drawer><afp-drawer[id]="'drawerBottom'"[placement]="'bottom'"><divslot="header">Bottom Drawer</div><p>This drawer slides in from the bottom of the screen.</p><divslot="footer"><afp-button[data-drawer]="'close'">Close</afp-button></div></afp-drawer><divclass="afp-cluster"><afp-button[onclick]="'drawerRight.show()'"> Right</afp-button><afp-button[onclick]="'drawerLeft.show()'">Left</afp-button><afp-button[onclick]="'drawerTop.show()'">Top</afp-button><afp-button[onclick]="'drawerBottom.show()'">Bottom</afp-button></div>
<AfpDrawerid="drawerRight"placement="right"><divslot="header">Right Drawer</div><p>This drawer slides in from the right side of the screen.</p><divslot="footer"><AfpButtondata-drawer="close">Close</AfpButton></div></AfpDrawer><AfpDrawerid="drawerLeft"placement="left"><divslot="header">Left Drawer</div><p>This drawer slides in from the left side of the screen.</p><divslot="footer"><AfpButtondata-drawer="close">Close</AfpButton></div></AfpDrawer><AfpDrawerid="drawerTop"placement="top"><divslot="header">Top Drawer</div><p>This drawer slides in from the top of the screen.</p><divslot="footer"><AfpButtondata-drawer="close">Close</AfpButton></div></AfpDrawer><AfpDrawerid="drawerBottom"placement="bottom"><divslot="header">Bottom Drawer</div><p>This drawer slides in from the bottom of the screen.</p><divslot="footer"><AfpButtondata-drawer="close">Close</AfpButton></div></AfpDrawer><divclass="afp-cluster"><AfpButtononclick="drawerRight.show()"> Right</AfpButton><AfpButtononclick="drawerLeft.show()">Left</AfpButton><AfpButtononclick="drawerTop.show()">Top</AfpButton><AfpButtononclick="drawerBottom.show()">Bottom</AfpButton></div>
<AfpDrawer:id="'drawerRight'":placement="'right'"><divslot="header">Right Drawer</div><p>This drawer slides in from the right side of the screen.</p><divslot="footer"><AfpButton:data-drawer="'close'">Close</AfpButton></div></AfpDrawer><AfpDrawer:id="'drawerLeft'":placement="'left'"><divslot="header">Left Drawer</div><p>This drawer slides in from the left side of the screen.</p><divslot="footer"><AfpButton:data-drawer="'close'">Close</AfpButton></div></AfpDrawer><AfpDrawer:id="'drawerTop'":placement="'top'"><divslot="header">Top Drawer</div><p>This drawer slides in from the top of the screen.</p><divslot="footer"><AfpButton:data-drawer="'close'">Close</AfpButton></div></AfpDrawer><AfpDrawer:id="'drawerBottom'":placement="'bottom'"><divslot="header">Bottom Drawer</div><p>This drawer slides in from the bottom of the screen.</p><divslot="footer"><AfpButton:data-drawer="'close'">Close</AfpButton></div></AfpDrawer><divclass="afp-cluster"><AfpButton:onclick="'drawerRight.show()'"> Right</AfpButton><AfpButton:onclick="'drawerLeft.show()'">Left</AfpButton><AfpButton:onclick="'drawerTop.show()'">Top</AfpButton><AfpButton:onclick="'drawerBottom.show()'">Bottom</AfpButton></div>
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
<afp-drawerid="drawerNoHeader"noheader><p>This drawer has no header. The content starts immediately.</p><divslot="footer"><afp-buttondata-drawer="close">Close</afp-button></div></afp-drawer><afp-buttononclick="drawerNoHeader.show()">Without Header</afp-button>
<afp-drawer[id]="'drawerNoHeader'"noheader><p>This drawer has no header. The content starts immediately.</p><divslot="footer"><afp-button[data-drawer]="'close'">Close</afp-button></div></afp-drawer><afp-button[onclick]="'drawerNoHeader.show()'">Without Header</afp-button>
<AfpDrawerid="drawerNoHeader"noheader><p>This drawer has no header. The content starts immediately.</p><divslot="footer"><AfpButtondata-drawer="close">Close</AfpButton></div></AfpDrawer><AfpButtononclick="drawerNoHeader.show()">Without Header</AfpButton>
<AfpDrawer:id="'drawerNoHeader'"noheader><p>This drawer has no header. The content starts immediately.</p><divslot="footer"><AfpButton:data-drawer="'close'">Close</AfpButton></div></AfpDrawer><AfpButton:onclick="'drawerNoHeader.show()'">Without Header</AfpButton>
Use the noFooter (nofooter) attribute to create a drawer without the footer section.
Without Footer
This drawer has no footer section.
Without Footer
<afp-drawerid="drawerNoFooter"nofootercloseable><divslot="header">Without Footer</div><p>This drawer has no footer section.</p></afp-drawer><afp-buttononclick="drawerNoFooter.show()">Without Footer</afp-button>
<afp-drawer[id]="'drawerNoFooter'"nofootercloseable><divslot="header">Without Footer</div><p>This drawer has no footer section.</p></afp-drawer><afp-button[onclick]="'drawerNoFooter.show()'">Without Footer</afp-button>
<AfpDrawerid="drawerNoFooter"nofootercloseable><divslot="header">Without Footer</div><p>This drawer has no footer section.</p></AfpDrawer><AfpButtononclick="drawerNoFooter.show()">Without Footer</AfpButton>
<AfpDrawer:id="'drawerNoFooter'"nofootercloseable><divslot="header">Without Footer</div><p>This drawer has no footer section.</p></AfpDrawer><AfpButton:onclick="'drawerNoFooter.show()'">Without Footer</AfpButton>
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
<afp-drawerid="drawerNoBackdrop"noBackdrop><divslot="header">No Backdrop</div><p>This drawer has no backdrop overlay, allowing interaction with the page behind.</p><divslot="footer"><afp-buttondata-drawer="close">Close</afp-button></div></afp-drawer><afp-buttononclick="drawerNoBackdrop.show()">Without Backdrop</afp-button>
<afp-drawer[id]="'drawerNoBackdrop'"noBackdrop><divslot="header">No Backdrop</div><p>This drawer has no backdrop overlay, allowing interaction with the page behind.</p><divslot="footer"><afp-button[data-drawer]="'close'">Close</afp-button></div></afp-drawer><afp-button[onclick]="'drawerNoBackdrop.show()'">Without Backdrop</afp-button>
<AfpDrawerid="drawerNoBackdrop"noBackdrop><divslot="header">No Backdrop</div><p>This drawer has no backdrop overlay, allowing interaction with the page behind.</p><divslot="footer"><AfpButtondata-drawer="close">Close</AfpButton></div></AfpDrawer><AfpButtononclick="drawerNoBackdrop.show()">Without Backdrop</AfpButton>
<AfpDrawer:id="'drawerNoBackdrop'"noBackdrop><divslot="header">No Backdrop</div><p>This drawer has no backdrop overlay, allowing interaction with the page behind.</p><divslot="footer"><AfpButton:data-drawer="'close'">Close</AfpButton></div></AfpDrawer><AfpButton:onclick="'drawerNoBackdrop.show()'">Without Backdrop</AfpButton>
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.
CancelConfirm
Closeable Drawer
<afp-drawerid="drawerCloseable"closeable><divslot="header">Closeable Drawer</div><p>This drawer can be closed by pressing ESC or clicking the backdrop.</p><divslot="footer"class="afp-cluster afp-gap-s"><afp-buttonappearance="filled"onclick="drawerCloseable.hide()">Cancel</afp-button><afp-buttononclick="drawerCloseable.hide()">Confirm</afp-button></div></afp-drawer><afp-buttononclick="drawerCloseable.show()">Closeable Drawer</afp-button>
<afp-drawer[id]="'drawerCloseable'"closeable><divslot="header">Closeable Drawer</div><p>This drawer can be closed by pressing ESC or clicking the backdrop.</p><divslot="footer"class="afp-cluster afp-gap-s"><afp-button[appearance]="'filled'"[onclick]="'drawerCloseable.hide()'">Cancel</afp-button><afp-button[onclick]="'drawerCloseable.hide()'">Confirm</afp-button></div></afp-drawer><afp-button[onclick]="'drawerCloseable.show()'">Closeable Drawer</afp-button>
<AfpDrawerid="drawerCloseable"closeable><divslot="header">Closeable Drawer</div><p>This drawer can be closed by pressing ESC or clicking the backdrop.</p><divslot="footer"class="afp-cluster afp-gap-s"><AfpButtonappearance="filled"onclick="drawerCloseable.hide()">Cancel</AfpButton><AfpButtononclick="drawerCloseable.hide()">Confirm</AfpButton></div></AfpDrawer><AfpButtononclick="drawerCloseable.show()">Closeable Drawer</AfpButton>
<AfpDrawer:id="'drawerCloseable'"closeable><divslot="header">Closeable Drawer</div><p>This drawer can be closed by pressing ESC or clicking the backdrop.</p><divslot="footer"class="afp-cluster afp-gap-s"><AfpButton:appearance="'filled'":onclick="'drawerCloseable.hide()'">Cancel</AfpButton><AfpButton:onclick="'drawerCloseable.hide()'">Confirm</AfpButton></div></AfpDrawer><AfpButton:onclick="'drawerCloseable.show()'">Closeable Drawer</AfpButton>
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)
<afp-drawerid="drawerCustomSize"style="--afp-drawer-size: 30rem;"><divslot="header">Custom Size</div><p>This drawer has a custom width of 30rem.</p><divslot="footer"><afp-buttondata-drawer="close">Close</afp-button></div></afp-drawer><afp-buttononclick="drawerCustomSize.show()">Custom Size (30rem)</afp-button>
<afp-drawer[id]="'drawerCustomSize'"[style]="'--afp-drawer-size: 30rem;'"><divslot="header">Custom Size</div><p>This drawer has a custom width of 30rem.</p><divslot="footer"><afp-button[data-drawer]="'close'">Close</afp-button></div></afp-drawer><afp-button[onclick]="'drawerCustomSize.show()'">Custom Size (30rem)</afp-button>
<AfpDrawerid="drawerCustomSize"style="--afp-drawer-size: 30rem;"><divslot="header">Custom Size</div><p>This drawer has a custom width of 30rem.</p><divslot="footer"><AfpButtondata-drawer="close">Close</AfpButton></div></AfpDrawer><AfpButtononclick="drawerCustomSize.show()">Custom Size (30rem)</AfpButton>
<AfpDrawer:id="'drawerCustomSize'":style="'--afp-drawer-size: 30rem;'"><divslot="header">Custom Size</div><p>This drawer has a custom width of 30rem.</p><divslot="footer"><AfpButton:data-drawer="'close'">Close</AfpButton></div></AfpDrawer><AfpButton:onclick="'drawerCustomSize.show()'">Custom Size (30rem)</AfpButton>
Use the duration attribute to customize the animation duration in milliseconds.
Slow Animation
This drawer has a slower animation (500ms).
Close
Slow Animation
<afp-drawerid="drawerSlowAnim"duration="500"><divslot="header">Slow Animation</div><p>This drawer has a slower animation (500ms).</p><divslot="footer"><afp-buttondata-drawer="close">Close</afp-button></div></afp-drawer><afp-buttononclick="drawerSlowAnim.show()">Slow Animation</afp-button>
<afp-drawer[id]="'drawerSlowAnim'"[duration]=500><divslot="header">Slow Animation</div><p>This drawer has a slower animation (500ms).</p><divslot="footer"><afp-button[data-drawer]="'close'">Close</afp-button></div></afp-drawer><afp-button[onclick]="'drawerSlowAnim.show()'">Slow Animation</afp-button>
<AfpDrawerid="drawerSlowAnim"duration="500"><divslot="header">Slow Animation</div><p>This drawer has a slower animation (500ms).</p><divslot="footer"><AfpButtondata-drawer="close">Close</AfpButton></div></AfpDrawer><AfpButtononclick="drawerSlowAnim.show()">Slow Animation</AfpButton>
<AfpDrawer:id="'drawerSlowAnim'":duration=500><divslot="header">Slow Animation</div><p>This drawer has a slower animation (500ms).</p><divslot="footer"><AfpButton:data-drawer="'close'">Close</AfpButton></div></AfpDrawer><AfpButton:onclick="'drawerSlowAnim.show()'">Slow Animation</AfpButton>
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
<afp-drawerid="drawerScrollable"><divslot="header">Scrollable Content</div><divclass="afp-stack afp-gap-m"><p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</p><p>Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.</p><p>Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.</p><p>Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p><p>Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium.</p><p>Nemo enim ipsam voluptatem quia voluptas sit aspernatur aut odit aut fugit.</p><p>Neque porro quisquam est, qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit.</p></div><divslot="footer"><afp-buttondata-drawer="close">Close</afp-button></div></afp-drawer><afp-buttononclick="drawerScrollable.show()">Scrollable Content</afp-button>
<afp-drawer[id]="'drawerScrollable'"><divslot="header">Scrollable Content</div><divclass="afp-stack afp-gap-m"><p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</p><p>Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.</p><p>Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.</p><p>Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p><p>Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium.</p><p>Nemo enim ipsam voluptatem quia voluptas sit aspernatur aut odit aut fugit.</p><p>Neque porro quisquam est, qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit.</p></div><divslot="footer"><afp-button[data-drawer]="'close'">Close</afp-button></div></afp-drawer><afp-button[onclick]="'drawerScrollable.show()'">Scrollable Content</afp-button>
<AfpDrawerid="drawerScrollable"><divslot="header">Scrollable Content</div><divclass="afp-stack afp-gap-m"><p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</p><p>Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.</p><p>Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.</p><p>Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p><p>Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium.</p><p>Nemo enim ipsam voluptatem quia voluptas sit aspernatur aut odit aut fugit.</p><p>Neque porro quisquam est, qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit.</p></div><divslot="footer"><AfpButtondata-drawer="close">Close</AfpButton></div></AfpDrawer><AfpButtononclick="drawerScrollable.show()">Scrollable Content</AfpButton>
<AfpDrawer:id="'drawerScrollable'"><divslot="header">Scrollable Content</div><divclass="afp-stack afp-gap-m"><p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</p><p>Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.</p><p>Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.</p><p>Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p><p>Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium.</p><p>Nemo enim ipsam voluptatem quia voluptas sit aspernatur aut odit aut fugit.</p><p>Neque porro quisquam est, qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit.</p></div><divslot="footer"><AfpButton:data-drawer="'close'">Close</AfpButton></div></AfpDrawer><AfpButton:onclick="'drawerScrollable.show()'">Scrollable Content</AfpButton>
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.
Typeboolean
Defaultfalse
noHeader noheader
Hides the header section.
Typeboolean
Defaultfalse
noFooter nofooter
Hides the footer section.
Typeboolean
Defaultfalse
noBackdrop nobackdrop
Whether the drawer has an overlay backdrop.
When false, the drawer opens without a backdrop overlay.
Typeboolean
Defaultfalse
duration
Animation duration in milliseconds for show/hide transitions.