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.PLAY1750pbcontenttagkitbutton5339 app/pb_kits/playbook/pb_drawer/docs/_drawer_overlay.jsx
playbook_ui-14.11.1.pre.alpha.PLAY1750pbcontenttagkitbutton5339 app/pb_kits/playbook/pb_drawer/docs/_drawer_overlay.jsx
playbook_ui_docs-14.12.0.pre.rc.3 app/pb_kits/playbook/pb_drawer/docs/_drawer_overlay.jsx
playbook_ui-14.12.0.pre.rc.3 app/pb_kits/playbook/pb_drawer/docs/_drawer_overlay.jsx
playbook_ui_docs-14.12.0.pre.rc.2 app/pb_kits/playbook/pb_drawer/docs/_drawer_overlay.jsx
playbook_ui-14.12.0.pre.rc.2 app/pb_kits/playbook/pb_drawer/docs/_drawer_overlay.jsx
playbook_ui_docs-14.12.0.pre.rc.1 app/pb_kits/playbook/pb_drawer/docs/_drawer_overlay.jsx
playbook_ui-14.12.0.pre.rc.1 app/pb_kits/playbook/pb_drawer/docs/_drawer_overlay.jsx
playbook_ui_docs-14.12.0.pre.rc.0 app/pb_kits/playbook/pb_drawer/docs/_drawer_overlay.jsx
playbook_ui-14.12.0.pre.rc.0 app/pb_kits/playbook/pb_drawer/docs/_drawer_overlay.jsx
playbook_ui_docs-14.10.0.pre.alpha.PLAY1774timelinelabelstepspacing5315 app/pb_kits/playbook/pb_drawer/docs/_drawer_overlay.jsx
playbook_ui-14.10.0.pre.alpha.PLAY1774timelinelabelstepspacing5315 app/pb_kits/playbook/pb_drawer/docs/_drawer_overlay.jsx
playbook_ui_docs-14.10.0.pre.alpha.PLAY1774timelinelabelstepspacing5314 app/pb_kits/playbook/pb_drawer/docs/_drawer_overlay.jsx
playbook_ui-14.10.0.pre.alpha.PLAY1774timelinelabelstepspacing5314 app/pb_kits/playbook/pb_drawer/docs/_drawer_overlay.jsx
playbook_ui_docs-14.10.0.pre.alpha.PLAY1750pbcontenttagkitbutton5308 app/pb_kits/playbook/pb_drawer/docs/_drawer_overlay.jsx
playbook_ui-14.10.0.pre.alpha.PLAY1750pbcontenttagkitbutton5308 app/pb_kits/playbook/pb_drawer/docs/_drawer_overlay.jsx
playbook_ui-14.11.1 app/pb_kits/playbook/pb_drawer/docs/_drawer_overlay.jsx
playbook_ui_docs-14.11.0.pre.rc.17 app/pb_kits/playbook/pb_drawer/docs/_drawer_overlay.jsx
playbook_ui-14.11.0.pre.rc.17 app/pb_kits/playbook/pb_drawer/docs/_drawer_overlay.jsx
playbook_ui-14.11.0 app/pb_kits/playbook/pb_drawer/docs/_drawer_overlay.jsx