UNPKG

@payfit/unity-components

Version:

34 lines (33 loc) 1.33 kB
import { ReactNode } from 'react'; import { DisclosureProps } from 'react-aria-components/Disclosure'; export interface CollapsibleProps extends Omit<DisclosureProps, 'isDisabled' | 'className'> { /** * The content of the collapsible component. * Typically includes a CollapsibleTitle and CollapsibleContent. */ children: ReactNode; /** * Controls whether the collapsible is expanded by default. * @default false */ isExpanded?: boolean; } /** * @description * The Collapsible component provides an expandable/collapsible container that can show or hide content. * It's typically used to organize information in a space-efficient way, allowing users to focus on relevant content. * @example * ```tsx * <Collapsible> * <CollapsibleTitle>Section Title</CollapsibleTitle> * <CollapsibleContent> * Content that can be shown or hidden * </CollapsibleContent> * </Collapsible> * ``` * @component * @see {@link CollapsibleTitle} - The clickable title component that toggles the expanded state * @see {@link CollapsibleContent} - The content component that is shown/hidden based on the expanded state */ declare const Collapsible: import('react').ForwardRefExoticComponent<CollapsibleProps & import('react').RefAttributes<HTMLDivElement>>; export { Collapsible };