UNPKG

adwaita-web

Version:

A GTK inspired toolkit designed to build awesome web apps

51 lines (50 loc) 1.73 kB
import React from "react"; export declare type ExpanderProps = React.PropsWithChildren<{ className?: string; size?: number; /** Expanded state */ open?: boolean; defaultOpen?: boolean; /** * The element that triggers toggling the expander. If not set, a default unstyled * button will be displayed. If it's a render function, it received an argument: ({ * toggle: Fn }) */ trigger?: React.ReactElement | ((param: { toggle: () => void; }) => React.ReactElement); /** The label for the default button trigger element (only if `trigger` is not set) */ label?: React.ReactNode; transition?: "horizontal" | "vertical"; /** Arrow position */ iconPosition?: "before" | "after" | false; /** If true, the trigger is rendered outside the Expander container */ contents?: boolean; /** If true, the container fits its content size */ fitContent?: boolean; /** Called when the open state changes */ onChange?: (open: boolean) => void; }>; declare type ExpanderState = { open: boolean; containerStyle: React.CSSProperties; }; export declare class Expander extends React.Component<ExpanderProps> { static defaultProps: { transition: string; iconPosition: string; contents: boolean; }; contentRef: React.MutableRefObject<HTMLDivElement | null>; state: ExpanderState; constructor(props: ExpanderProps); setOpen: (open: boolean) => void; componentDidUpdate(): void; updateDimensions(): void; isOpen(): boolean; getProperty(): "width" | "height"; getContainerStyle(): React.CSSProperties; onRef: (ref: HTMLDivElement) => void; render(): JSX.Element; } export {};