Sha256: 051e39ee32bfa72db86f21b45a96ac662f0d6c857f50414da02376f393790ba5
Contents?: true
Size: 1.03 KB
Versions: 145
Compression:
Stored size: 1.03 KB
Contents
import React, { useState } from 'react' import { Body, Button, PbReactPopover, } from '../..' const PopoverZIndex = () => { const [showPopover, setShowPopover] = useState(false) const handleTogglePopover = () => { setShowPopover(!showPopover) } const handleShouldClosePopover = (shouldClosePopover) => { setShowPopover(!shouldClosePopover) } const popoverTrigger = ( <Button onClick={handleTogglePopover} text="Click Me" variant="secondary" /> ) return ( <> <div style={{ position: 'relative', zIndex: 2 }}> <Body marginBottom="md" text="I've got a z-index of 2" /> </div> <PbReactPopover closeOnClick="outside" offset placement="top" reference={popoverTrigger} shouldClosePopover={handleShouldClosePopover} show={showPopover} zIndex={3} > {'I have a custom z-index of 3'} </PbReactPopover> </> ) } export default PopoverZIndex
Version data entries
145 entries across 145 versions & 1 rubygems