UNPKG

@base-ui-components/react

Version:

Base UI is a library of headless ('unstyled') React components and low-level hooks. You gain complete control over your app's CSS and accessibility features.

48 lines (47 loc) 1.64 kB
import * as React from 'react'; import { TransitionStatus } from '../../utils/useTransitionStatus.js'; export declare function useCollapsibleRoot(parameters: useCollapsibleRoot.Parameters): useCollapsibleRoot.ReturnValue; export declare namespace useCollapsibleRoot { interface Parameters { /** * Whether the collapsible panel is currently open. * * To render an uncontrolled collapsible, use the `defaultOpen` prop instead. */ open?: boolean; /** * Whether the collapsible panel is initially open. * * To render a controlled collapsible, use the `open` prop instead. * @default false */ defaultOpen?: boolean; /** * Event handler called when the panel is opened or closed. */ onOpenChange: (open: boolean) => void; /** * Whether the component should ignore user interaction. * @default false */ disabled: boolean; } interface ReturnValue { panelId: React.HTMLAttributes<Element>['id']; /** * Whether the component should ignore user interaction. */ disabled: boolean; mounted: boolean; /** * Whether the collapsible panel is currently open. * * To render an uncontrolled collapsible, use the `defaultOpen` prop instead. */ open: boolean; setPanelId: (id: string | undefined) => void; setMounted: (open: boolean) => void; setOpen: (open: boolean) => void; transitionStatus: TransitionStatus; } }