Warning
This is an internal project, and is not intended for public use. No support or stability guarantees are provided.
A button that opens the alert dialog.
Renders a <button> element.
| Prop | Type | Description |
|---|---|---|
| disabled | | Whether the trigger is disabled. |
| children | | Child elements. |
| className | | CSS class applied to the trigger element. Can be a string or a function that receives the state. |
type AlertDialogTriggerProps = {
/**
* CSS class applied to the trigger element.
* Can be a string or a function that receives the state.
*/
className?: string | ((state: AlertDialog.Trigger.State) => string);
/** Whether the trigger is disabled. */
disabled?: boolean;
/** Child elements. */
children?: React.ReactNode;
}type AlertDialogTriggerState = {
/** Whether the alert requires user acknowledgment. */
requiresAcknowledgment: boolean;
/** Whether the dialog is currently open. */
open: boolean;
/** Whether the trigger is disabled. */
disabled: boolean;
}A button that closes the dialog.
Renders a <button> element.
| Prop | Type | Description |
|---|---|---|
| children | | Child elements. |
| render | | Render function that receives the trigger state. This demonstrates a component depending on another component’s state type. |
type AlertDialogCloseProps = {
/**
* Render function that receives the trigger state.
* This demonstrates a component depending on another component's state type.
*/
render?: (triggerState: DialogTriggerState) => React.ReactNode;
/** Child elements. */
children?: React.ReactNode;
}import * as React from 'react';
import { TypesAlertDialog as AlertDialogTypes } from './types';
export function TypesAlertDialog() {
return (
<div>
<h3>Alert Dialog API</h3>
<h3>Trigger</h3>
<AlertDialogTypes.Trigger />
<h3>Close</h3>
<AlertDialogTypes.Close />
</div>
);
}