UNPKG

@material-tailwind/html

Version:

Material Tailwind is an open-source library that uses the power of Tailwind CSS and React to help you build unique web projects faster and easier. The stunning design inspired by Material Design is a bonus!

42 lines (41 loc) 1.09 kB
import type { PopoverConfig, IPopover } from "./popover.types"; /** * Class representing a programmatic Popover component. */ export declare class Popover implements IPopover { private trigger; private config; private popperInstance; private popoverElement; /** * Creates an instance of Popover. * @param trigger - The element that triggers the popover. * @param config - Configuration options for the popover. */ constructor(trigger: HTMLElement, config: PopoverConfig); /** * Initializes the Popover instance. */ private init; /** * Handles the click event on the trigger element. * @param event - The click event. */ private handleTriggerClick; /** * Opens the popover programmatically. */ open(): Promise<void>; /** * Closes the popover programmatically. */ close(): void; /** * Toggles the popover's visibility programmatically. */ toggle(): void; /** * Destroys the Popover instance and cleans up resources. */ destroy(): void; }