@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.
30 lines (29 loc) • 1.04 kB
TypeScript
import * as React from 'react';
import { GenericHTMLProps } from '../../utils/types.js';
export declare function useCollapsibleTrigger(parameters: useCollapsibleTrigger.Parameters): useCollapsibleTrigger.ReturnValue;
export declare namespace useCollapsibleTrigger {
interface Parameters {
/**
* The id of the element controlled by the Trigger
*/
panelId: React.HTMLAttributes<Element>['id'];
/**
* Whether the component should ignore user interaction.
*/
disabled: boolean;
/**
* Whether the collapsible panel is currently open.
*
* To render an uncontrolled collapsible, use the `defaultOpen` prop instead.
*/
open: boolean;
rootRef: React.Ref<Element>;
/**
* A state setter that sets the open state of the Collapsible
*/
setOpen: (open: boolean) => void;
}
interface ReturnValue {
getRootProps: (externalProps?: GenericHTMLProps) => GenericHTMLProps;
}
}