Skip to content

Latest commit

 

History

History

use-popover

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 

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>
        </>
    );
}