Skip to content

Latest commit

 

History

History
24 lines (19 loc) · 487 Bytes

readme.md

File metadata and controls

24 lines (19 loc) · 487 Bytes

usePopover

The usePopover hook is a simple utility allows you to easily add Popovers to any element.

Usage

import { usePopover } from '@10up/block-components';

function BlockEdit(props) {
    const { toggleProps, Popover } = usePopover();

    return (
        <>
            <button {...toggleProps}>
               Open Popover
            </button>
            <Popover>
                I'm rendered inside a Popover
            </Popover>
        </>
    );
}