Arctic Design
Get StartedFoundationsComponentsExamples
K

Drawer

Displays a sliding panel from the edge of the screen, offering access to additional content or actions without leaving the current view.

Usage
Position
Action Size
Hide Header
Hide Footer
Disable Outside Press And Escape
Loading
import { useState } from 'react';
import {
Autocomplete,
Box,
Button,
Drawer,
DrawerProps,
Grid,
GridColumn,
GridRow,
SegmentedControl,
SegmentedControlButton,
Select,
TextInput,
} from '@arctic-kit/snow';
function Demo() {
const [isDrawerOpen, setDrawerOpen] = useState(false);
const toggleDrawer = () => {
setDrawerOpen(!isDrawerOpen);
};
return (
<Box sx={{ display: 'flex' }}>
<Button onClick={toggleDrawer}>Toggle Drawer</Button>
<Drawer
title="Drawer Title" titleFooter="Title Footer section" position="left" size="medium" cancelLabel="Cancel" actionLabel="Save" actionSize="medium"
open={isDrawerOpen}
onOpenChange={toggleDrawer}
onCancel={toggleDrawer}
onAction={toggleDrawer}
onClose={toggleDrawer}
>
<Grid spacing={1}>
<GridRow>
<GridColumn xs={12} lg={6}>
<SegmentedControl>
<SegmentedControlButton>React</SegmentedControlButton>
<SegmentedControlButton>Angular</SegmentedControlButton>
<SegmentedControlButton>Vue</SegmentedControlButton>
</SegmentedControl>
</GridColumn>
<GridColumn xs={12} lg={6}>
<TextInput label='First name' />
</GridColumn>
<GridColumn xs={12} lg={6}>
<TextInput label='Second name' />
</GridColumn>
<GridColumn xs={12} lg={6}>
<Select
label='Fruit'
options={[
'Apple',
'Banana',
'Orange',
'Mango',
'Pineapple',
'Grapes',
'Strawberry',
'Watermelon',
'Kiwi',
'Peach',
'Plum',
]}
placeholder='Select a fruit'
/>
</GridColumn>
<GridColumn xs={12} lg={6}>
<Autocomplete
label='Car'
options={['Audi', 'BMW', 'Chevrolet', 'Dodge']}
placeholder='Select a car'
/>
</GridColumn>
</GridRow>
</Grid>
</Drawer>
</Box>
);
}

API Reference

PropsTypeDefault
actionLabelstring | undefined---
actionSize"small" | "medium" | "large"---
cancelLabelstring | undefined---
disableOutsidePressAndEscapeboolean | undefined---
hideFooterboolean | undefined---
hideHeaderboolean | undefined---
loadingboolean | undefined---
onAction(() => void) | undefined---
onCancel(() => void) | undefined---
onClose(() => void) | undefined---
onOpenChange((open: boolean) => void) | undefined---
openboolean---
positionDrawerPosition---
sizeDrawerSize---
titlestring | undefined---
titleFooterReactNode---