@stihl-design-system/components
Version:
Welcome to the STIHL Design System react component library.
41 lines (40 loc) • 1.8 kB
TypeScript
import { HTMLProps, JSX } from 'react';
import { OpenChangeReason, Placement } from '@floating-ui/react';
export interface PopoverProps {
/** Content within the Popover. */
children?: React.ReactNode;
/** Opens the Popover on initial render.
* @default false
*/
initialOpen?: boolean;
/** The placement of the Popover relative to the anchor element.
* @default 'bottom-start'
*/
placement?: Placement;
/** The offset distance in "px" between the Popover and its anchor element.
* @default 6
*/
popoverOffset?: number;
/** Controls the open state of the Popover. If provided, it will be a controlled component.
* @default false
*/
isOpen?: boolean;
/** A function that is called when the open state should change. */
onOpenChange?: (isOpen: boolean, event?: Event, reason?: OpenChangeReason) => void;
}
/**
* The Popover component is used to display additional information or actions related to an anchor element. It can be positioned relative to the anchor and supports various placements and offsets.
*
* Design in Figma: [Popover](https://www.figma.com/design/Ie2r0R9QwjEc7O3nrFbXhV/branch/DNB69TwlN0FaaVg7yVsYu4/Web-Pattern-Library?node-id=6263-62113&t=NnUduFxcjRqgbtO9-11)
* */
export declare const DSPopover: {
({ children, ...rest }: PopoverProps): JSX.Element;
/** attach static members */
Anchor: import('react').ForwardRefExoticComponent<Omit<HTMLProps<HTMLElement> & PopoverAnchorProps, "ref"> & import('react').RefAttributes<HTMLElement>>;
Content: import('react').ForwardRefExoticComponent<Omit<HTMLProps<HTMLDivElement>, "ref"> & import('react').RefAttributes<HTMLDivElement>>;
displayName: string;
};
interface PopoverAnchorProps {
children: React.ReactNode;
}
export {};