Introducing Socket Firewall: Free, Proactive Protection for Your Software Supply Chain.Learn More
Socket
Book a DemoInstallSign in
Socket

@highlight-ui/drawer

Package Overview
Dependencies
Maintainers
10
Versions
163
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@highlight-ui/drawer

A modal panel that slides in from the side of the page

latest
npmnpm
Version
5.6.2
Version published
Weekly downloads
1
Maintainers
10
Weekly downloads
 
Created
Source

npm personio.design storybook.personio.design

@highlight-ui/drawer

Installation

Using npm:

npm install @highlight-ui/drawer

Using yarn:

yarn add @highlight-ui/drawer

Using pnpm:

pnpm install @highlight-ui/drawer

In your (S)CSS file:

@import url('@highlight-ui/drawer');

Once the package is installed, you can import the library:

import { Drawer, DrawerHeader, DrawerBody } from '@highlight-ui/drawer';

Usage

import React from 'react';
import { Drawer, DrawerHeader, DrawerBody } from '@highlight-ui/drawer';

export default function DrawerExample() {
  return (
    <Drawer visible={false} onClose={handleOnClose} onOpen={handleOnOpen}>
      <DrawerHeader>
        <Typography component="h1" token="heading-2xl">
          Drawer
        </Typography>
      </DrawerHeader>
      <DrawerBody>Drawer content</DrawerBody>
    </Drawer>
  );
}

Props 📜

Drawer

PropTypeRequiredDefaultDescription
visiblebooleanNofalseControls the visibility of the drawer
childrenReact.ReactNodeNoShould be an instance of DrawerHeader followed by an instance of DrawerBody
drawerClassNamestringNoAllows providing a custom class name for the drawer
closeKeyReact.KeyboardEvent['key']NoEscapeEvent keycode that should trigger the drawer to close
disabledBodyScrollingbooleanNotrueControls the scrolling behavior of the document when the drawer is open
leftOffsetReact.CSSProperties['left']No280pxControls the width of the drawer: (100% - leftOffset)
topOffsetReact.CSSProperties['top']No0pxControls the height of the drawer: (100% - topOffset)
onClose() => voidNoCallback that is invoked after the drawer is closed
onOpen() => voidNoCallback that is invoked after the drawer is opened
onRequestToClose() => voidNoCallback that is invoked when the close key is pressed (if preventToClose is set to false)
preventToClosebooleanNofalseControls whether the onRequestToClose callback should be executed or not
enableBackdropbooleanNofalseControls the visibility of the backdrop
onBackdropClick() => voidNoCallback that is invoked when user clicks on the backdrop
backdropClassNamestringNoAllows providing a custom class name for the backdrop

DrawerHeader

PropTypeRequiredDefaultDescription
fixedbooleanNofalseControls whether the drawer header should be fixed (when scrolling)
classNamestringNoAllows providing a custom class name

DrawerBody

PropTypeRequiredDefaultDescription
classNamestringNoAllows providing a custom class name

Contributing 🖌️

Please visit personio.design for usage guidelines and visual examples.

If you're interested in contributing, please visit our contribution page.

FAQs

Package last updated on 23 Jan 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts