--- localeCode: en-US order: 62 category: Show title: SideSheet subTitle: SideSheet icon: doc-sidesheet brief: An overlay panel that slides out from the edge of the screen, typically used to host secondary action pages. --- ## Demos ### How to import ```jsx import import { SideSheet } from '@douyinfe/semi-ui'; ``` ### Basic Usage By default, SideSheet slides from the right side of the screen and could be closed by clicking on the mask. ```jsx live=true import React, { useState } from 'react'; import { SideSheet, Button } from '@douyinfe/semi-ui'; () => { const [visible, setVisible] = useState(false); const change = () => { setVisible(!visible); }; return ( <>

This is the content of a basic sidesheet.

Here is more content...

); }; ``` ### Placement You could use `placement` to set the position from which SideSheet comes in, supporting one of `top`, `bottom`, `left`, `right`。 ```jsx live=true import React, { useState } from 'react'; import { SideSheet, RadioGroup, Radio, Button } from '@douyinfe/semi-ui'; () => { const [visible, setVisible] = useState(false); const change = () => { setVisible(!visible); }; const [placement, setPlacement] = useState('right'); const changePlacement = e => { setPlacement(e.target.value); }; return ( <> right left top bottom

This is the content of a basic sidesheet.

Here is more content...

); }; ``` ### Size You could use `size` to set the size of SideSheet, supporting one of `small`(448px), `medium`(684px), and `large`(920px). Only takes effects when `placement` is set to `left` or `right`, and used after `v0.29.0`. If the default size does not meet your needs, you can also set the width by setting the `width` property, for example `width={900}` / `width={'800px'}` ```jsx live=true import React, { useState } from 'react'; import { SideSheet, RadioGroup, Radio, Button } from '@douyinfe/semi-ui'; () => { const [visible, setVisible] = useState(false); const change = () => { setVisible(!visible); }; const [size, setSize] = useState('small'); const changeSize = e => { setSize(e.target.value); }; return ( <> small medium large

This is the content of a basic sidesheet.

Here is more content...

); }; ``` ### Non-blocking Workflow After `v0.29.0`, you could set `mask={false}` to continue working on the area outside SideSheet. By default, if you are not setting `getPopupContainer`, SideSheet is rendered inside body. If you want body element to be able to scroll, you could set disableScroll to false and the component will not add `overflow: hidden` to it. ```jsx live=true import React, { useState } from 'react'; import { SideSheet, Button, TextArea } from '@douyinfe/semi-ui'; () => { const [visible, setVisible] = useState(false); const [value, setValue] = useState(''); return ( <>