Sha256: 1ede1724a7077a8bceeb482c4f8ff00426f0de42ac13812e07016243687c0d0c

Contents?: true

Size: 1.45 KB

Versions: 598

Compression:

Stored size: 1.45 KB

Contents

import React, { useState } from "react";
import { Button, Drawer, Flex } from "playbook-ui";

const DrawerSizes = () => {
  // Individual state variables for each drawer size
  const [openedNoOverlayDrawer, setOpenedNoOverlayDrawer] = useState(false);
  const [openedOverlayDrawer, setOpenedOverlayDrawer] = useState(false);

  // Toggle functions for each drawer
  const toggleNoOverlayDrawer = () => setOpenedNoOverlayDrawer(!openedNoOverlayDrawer);
  const toggleOverlayDrawer = () => setOpenedOverlayDrawer(!openedOverlayDrawer);

  return (
    <>
      <Flex wrap>
        <Button marginRight="md"
            onClick={toggleNoOverlayDrawer}
        >
          No Overlay Drawer
        </Button>
        <Button marginRight="md"
            onClick={toggleOverlayDrawer}
        >
          Overlay Drawer
        </Button>
      </Flex>

      {/* Drawers for each size */}
      <Drawer
          behavior="push"
          fullHeight
          onClose={toggleNoOverlayDrawer}
          opened={openedNoOverlayDrawer}
          overlay={false}
          placement="right"
          size="lg"
      >
        This is a Drawer with no overlay
      </Drawer>
      <Drawer
          behavior="push"
          fullHeight
          onClose={toggleOverlayDrawer}
          opened={openedOverlayDrawer}
          overlay
          placement="right"
          size="lg"
      >
        This is a Drawer with an overlay 
      </Drawer>
    </>
  );
};

export default DrawerSizes;

Version data entries

598 entries across 598 versions & 2 rubygems

Version Path
playbook_ui_docs-14.11.1.pre.alpha.PBNTR798datepickerturbo5537 app/pb_kits/playbook/pb_drawer/docs/_drawer_overlay.jsx
playbook_ui-14.11.1.pre.alpha.PBNTR798datepickerturbo5537 app/pb_kits/playbook/pb_drawer/docs/_drawer_overlay.jsx
playbook_ui_docs-14.11.1.pre.alpha.pbntr703collapsiblerowsrails5536 app/pb_kits/playbook/pb_drawer/docs/_drawer_overlay.jsx
playbook_ui-14.11.1.pre.alpha.pbntr703collapsiblerowsrails5536 app/pb_kits/playbook/pb_drawer/docs/_drawer_overlay.jsx
playbook_ui_docs-14.11.1.pre.alpha.PLAY1751pbcontenttagpt25529 app/pb_kits/playbook/pb_drawer/docs/_drawer_overlay.jsx
playbook_ui-14.11.1.pre.alpha.PLAY1751pbcontenttagpt25529 app/pb_kits/playbook/pb_drawer/docs/_drawer_overlay.jsx
playbook_ui_docs-14.11.1.pre.alpha.PBNTR7495495 app/pb_kits/playbook/pb_drawer/docs/_drawer_overlay.jsx
playbook_ui-14.11.1.pre.alpha.PBNTR7495495 app/pb_kits/playbook/pb_drawer/docs/_drawer_overlay.jsx
playbook_ui_docs-14.12.0.pre.rc.11 app/pb_kits/playbook/pb_drawer/docs/_drawer_overlay.jsx
playbook_ui-14.12.0.pre.rc.11 app/pb_kits/playbook/pb_drawer/docs/_drawer_overlay.jsx
playbook_ui_docs-14.12.0.pre.rc.10 app/pb_kits/playbook/pb_drawer/docs/_drawer_overlay.jsx
playbook_ui-14.12.0.pre.rc.10 app/pb_kits/playbook/pb_drawer/docs/_drawer_overlay.jsx
playbook_ui_docs-14.12.0.pre.rc.9 app/pb_kits/playbook/pb_drawer/docs/_drawer_overlay.jsx
playbook_ui-14.12.0.pre.rc.9 app/pb_kits/playbook/pb_drawer/docs/_drawer_overlay.jsx
playbook_ui_docs-14.12.0.pre.rc.8 app/pb_kits/playbook/pb_drawer/docs/_drawer_overlay.jsx
playbook_ui-14.12.0.pre.rc.8 app/pb_kits/playbook/pb_drawer/docs/_drawer_overlay.jsx
playbook_ui_docs-14.12.0.pre.rc.7 app/pb_kits/playbook/pb_drawer/docs/_drawer_overlay.jsx
playbook_ui-14.12.0.pre.rc.7 app/pb_kits/playbook/pb_drawer/docs/_drawer_overlay.jsx
playbook_ui_docs-14.11.1.pre.alpha.play1724darkmodeauditmap5437 app/pb_kits/playbook/pb_drawer/docs/_drawer_overlay.jsx
playbook_ui-14.11.1.pre.alpha.play1724darkmodeauditmap5437 app/pb_kits/playbook/pb_drawer/docs/_drawer_overlay.jsx