Drawer

A Drawer is a panel that is typically overlaid on top of a page and slides in from the side. It contains a set of information or actions. Since the user can interact with the Drawer without leaving the current page, tasks can be achieved more efficiently within the same context.

  • Use a Form to create or edit a set of information
  • Processing subtasks. When subtasks are too heavy for a Popover and we still want to keep the subtasks in the context of the main task, Drawer comes very handy.
  • When the same Form is needed in multiple places.

Usage

The Drawer component can be imported using

import { Drawer } from '@tail-kit/tail-kit'

Basic Drawer

Custom Placement

Submit Form in Drawer

Drawer Props

NameDescriptionDefault Value
children
content rendered inside the modal
ReactNode
--
closable
Whether a close (x) button is visible on top right of the Drawer dialog or not
boolean | undefined
--
footer
The footer for Drawer
ReactNode
--
onRequestClose
function called when the user is closing the drawer, either by clicking on cancel button or overlay
(() => void) | undefined
--
title
title of the drawer
ReactNode
--
placement
The placement of the Drawer
"left" | "right" | "top" | "bottom" | undefined
right
portalParent
parent of the portal container
HTMLElement | undefined
typeof window !== 'undefined' ? document.body : undefined
size
Define the size of drawer (width in case of left or right placement and height in case of top or bottom placement)
number | undefined
256
visible
whether drawer is visible or not
boolean
--
className
Additional classes applied to the Drawer component
string | undefined
--
style
Additional styles applied to the Drawer component
CSSProperties | undefined
--