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.

43 lines 1.48 kB
import * as React from 'react'; import type { BaseUIComponentProps, NativeButtonProps } from "../../utils/types.js"; import { DialogHandle } from "../store/DialogHandle.js"; /** * A button that opens the dialog. * Renders a `<button>` element. * * Documentation: [Base UI Dialog](https://base-ui.com/react/components/dialog) */ export declare const DialogTrigger: DialogTrigger; export interface DialogTrigger { <Payload>(componentProps: DialogTriggerProps<Payload> & React.RefAttributes<HTMLElement>): React.JSX.Element; } export interface DialogTriggerProps<Payload = unknown> extends NativeButtonProps, BaseUIComponentProps<'button', DialogTrigger.State> { /** * A handle to associate the trigger with a dialog. * Can be created with the Dialog.createHandle() method. */ handle?: DialogHandle<Payload>; /** * A payload to pass to the dialog when it is opened. */ payload?: Payload; /** * ID of the trigger. In addition to being forwarded to the rendered element, * it is also used to specify the active trigger for the dialogs in controlled mode (with the DialogRoot `triggerId` prop). */ id?: string; } export interface DialogTriggerState { /** * Whether the dialog is currently disabled. */ disabled: boolean; /** * Whether the dialog is currently open. */ open: boolean; } export declare namespace DialogTrigger { type Props<Payload = unknown> = DialogTriggerProps<Payload>; type State = DialogTriggerState; }