Sheet
Basic Usage
Show editable code example
Any Paragon component or export may be added to the code example.
() => {const [blocking, setBlocking] = useState(false);const [dark, setDark] = useState(false);const [position, setPosition] = useState('bottom');const [show, setShow] = useState(false);const positions = ['left', 'right', 'top', 'bottom'];return (<><DropdownButtonid="position-dropdown-btn"onSelect={setPosition}title="Sheet Position">{positions.map(position => (<Dropdown.Item eventKey={position}>{position}</Dropdown.Item>))}</DropdownButton><br /><Button onClick={() => setShow(true)} className="mb-2 mb-md-0">Show the Sheet</Button>{' '}<Button onClick={() => setBlocking(!blocking)} className="mb-2 mb-md-0">{blocking ? "Disable": "Enable"} blocking content</Button>{' '}<Button onClick={() => setDark(!dark)} className="mb-2 mb-md-0">Set {dark ? "Light": "Dark"} mode</Button><Sheetposition={position}show={show}blocking={blocking}variant={dark ? 'dark' : 'light'}onClose={() => setShow(false)}>This is a Sheet component <br /><ButtononClick={() => setShow(false)}variant={dark ? 'inverse-primary' : 'primary'}>Hide Me!</Button></Sheet></>)}
Props API#
Sheet Props API
- blocking
bool
Defaultfalsespecifies whether the sheet provides a click-blocking scrim
- children
node
an element rendered inside the sheet
- position
enum
'left' | 'right' | 'top' | 'bottom'Default'bottom'a string designating the sheet's position on the window
- show
bool
DefaulttrueBoolean used to control whether the Sheet shows.
- onClose
func
Default() => {}Specifies function that controls
show
value. - variant
enum
'light' | 'dark'Default'light'a string designating which version of the sheet to show (light vs dark)
Usage Insights#
Sheet
Project Name | Paragon Version | Instance Count | |
---|---|---|---|
frontend-app-learner-dashboard | 20.32.0 | 1 |