From f242840275a77af1b6d977bb10b97ae9324799e5 Mon Sep 17 00:00:00 2001 From: Jess <53754871+jessover9000@users.noreply.github.com> Date: Wed, 8 Jul 2020 17:29:33 +0200 Subject: [PATCH] Create ConfirmButton.mdx (#26113) add docs to ConfirmButton element --- .../src/components/ConfirmButton/ConfirmButton.mdx | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 packages/grafana-ui/src/components/ConfirmButton/ConfirmButton.mdx diff --git a/packages/grafana-ui/src/components/ConfirmButton/ConfirmButton.mdx b/packages/grafana-ui/src/components/ConfirmButton/ConfirmButton.mdx new file mode 100644 index 00000000000..88ade6d957d --- /dev/null +++ b/packages/grafana-ui/src/components/ConfirmButton/ConfirmButton.mdx @@ -0,0 +1,11 @@ + + +# ConfirmButton + +The ConfirmButton is an interactive component that adds a double-confirm option to a clickable action. When clicked, the action is replaced by an inline confirmation with the option to cancel. In Grafana, this is used for example for editing values in settings tables. + +## Variants + +There are four variants of the `ConfirmButton`: primary, secondary, destructive, and link. The primary and secondary variants include a primary or secondary `Button` component. The primary and secondary variant should be used to confirm actions like saving or adding data. The destructive variant includes a destructive `Button` component. The destructive variant should be used to double-confirm a deletion or removal of an element. The link variant doesn't include any button and double-confirms as links instead. + +Apart from the button variant, you can also modify the button size and the button text.