@helpwave/hightide
Version:
helpwave's component and theming library
34 lines (31 loc) • 999 B
text/typescript
import * as react from 'react';
import { PropsWithChildren, ReactNode } from 'react';
type IconBuilder = (expanded: boolean) => ReactNode;
type ExpandableProps = PropsWithChildren<{
label: ReactNode;
icon?: IconBuilder;
initialExpansion?: boolean;
/**
* Whether the expansion should only happen when the header is clicked or on the entire component
*/
clickOnlyOnHeader?: boolean;
className?: string;
headerClassName?: string;
}>;
/**
* A Component for showing and hiding content
*/
declare const Expandable: react.ForwardRefExoticComponent<{
label: ReactNode;
icon?: IconBuilder;
initialExpansion?: boolean;
/**
* Whether the expansion should only happen when the header is clicked or on the entire component
*/
clickOnlyOnHeader?: boolean;
className?: string;
headerClassName?: string;
} & {
children?: ReactNode | undefined;
} & react.RefAttributes<HTMLDivElement>>;
export { Expandable, type ExpandableProps };