diff --git a/src/Drawer/Drawer.jsx b/src/Drawer/Drawer.jsx index a75aebf8..88f73b25 100644 --- a/src/Drawer/Drawer.jsx +++ b/src/Drawer/Drawer.jsx @@ -25,6 +25,7 @@ const Drawer = ({ behindNav, children, className, + defaultExpanded, expandable, hasBackgroundOverlay, visible, @@ -32,7 +33,7 @@ const Drawer = ({ size, onRequestClose, }) => { - const [expanded, setExpanded] = useState(false); + const [expanded, setExpanded] = useState(defaultExpanded); const handleExpand = () => setExpanded(!expanded); @@ -86,6 +87,7 @@ Drawer.propTypes = { behindNav: propTypes.bool, children: propTypes.node, className: propTypes.string, + defaultExpanded: propTypes.bool, expandable: propTypes.bool, hasBackgroundOverlay: propTypes.bool, orientation: propTypes.oneOf([ORIENTATION_LEFT, ORIENTATION_RIGHT]), @@ -98,6 +100,7 @@ Drawer.defaultProps = { behindNav: true, children: undefined, className: null, + defaultExpanded: false, expandable: false, hasBackgroundOverlay: true, orientation: ORIENTATION_RIGHT, diff --git a/src/Drawer/Drawer.mdx b/src/Drawer/Drawer.mdx index 11ea2f14..fda82015 100644 --- a/src/Drawer/Drawer.mdx +++ b/src/Drawer/Drawer.mdx @@ -15,7 +15,7 @@ import * as ComponentStories from './Drawer.stories'; -### When to use +### When to use When we want to focus the user’s attention on an interactive interface or a large amount of information ### When to not use @@ -50,7 +50,11 @@ Pass `orientation="left"` to override the default behavior of sliding in from th ### Expandable -Setting `expandable` allows the drawer to expand to the full size of the viewport +Setting `expandable` allows the drawer to expand to the full size of the viewport when the expand button is clicked. + +### Default Expanded + +Setting `defaultExpanded` allows the drawer to expand the full size of the viewport by default. ### Additional Actions