npm install --save @idui/react-sheet
yarn add @idui/react-sheet
- can be resizable
- uses styled-components
- has 4 different placements (bottom, top, right, left)
- can be controlled by children function
- can be closed by content function
See props in Docs
import React from 'react'
import Sheet from '@idui/react-sheet'
function Example() {
return <Sheet
content={<span>Sheet Content</span>}
>
<button>Open Sheet</button>
</Sheet>
}
import React from 'react'
import Sheet from '@idui/react-sheet'
function Example() {
return <Sheet
content={<span>Sheet Content</span>}
resizable
onResize={(size) => console.log(`New sheet size = ${size}px`)}
>
<button>Open Sheet</button>
</Sheet>
}
import React from 'react'
import Sheet from '@idui/react-sheet'
function Example() {
return <Sheet
content={({close}) => <button onClick={close}>close</button>}
resizable
>
{({open, close, toggle}) => <div>
<button onClick={open}>open</button>
<button onClick={close}>close</button>
<button onClick={toggle}>toggle</button>
</div>}
</Sheet>
}
See more details in storybook
MIT © [email protected]