Commit 12668392 by Alex Khomenko Committed by GitHub

Grafana-UI: Expand ConfirmModal docs (#27541)

parent 1983de96
......@@ -7,4 +7,18 @@ import { ConfirmModal } from './ConfirmModal';
Used to request user for action confirmation, e.g. deleting items. Triggers provided 'onConfirm' callback.
# Usage
```jsx
<ConfirmModal
isOpen={false}
title='Delete user'
body='Are you sure you want to delete this user?'
confirmText='Confirm'
icon='exclamation-triangle'
onConfirm={() => console.log('Confirm action')}
onDismiss={() => console.log('Dismiss action')}
/>
```
<Props of={ConfirmModal} />
......@@ -8,13 +8,21 @@ import { GrafanaTheme } from '@grafana/data';
import { HorizontalGroup } from '..';
export interface Props {
/** Toggle modal's open/closed state */
isOpen: boolean;
/** Title for the modal header */
title: string;
/** Modal content */
body: React.ReactNode;
/** Text for confirm button */
confirmText: string;
/** Text for dismiss button */
dismissText?: string;
/** Icon for the modal header */
icon?: IconName;
/** Confirm action callback */
onConfirm(): void;
/** Dismiss action callback */
onDismiss(): void;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment