No Preview

Sorry, but you either have no stories or none are selected somehow.

If the problem persists, check the browser console, or the terminal you've run Storybook from.

The component failed to render properly, likely due to a configuration issue in Storybook. Here are some common causes and how you can address them:

  1. Missing Context/Providers: You can use decorators to supply specific contexts or providers, which are sometimes necessary for components to render correctly. For detailed instructions on using decorators, please visit the Decorators documentation.
  2. Misconfigured Webpack or Vite: Verify that Storybook picks up all necessary settings for loaders, plugins, and other relevant parameters. You can find step-by-step guides for configuring Webpack or Vite with Storybook.
  3. Missing Environment Variables: Your Storybook may require specific environment variables to function as intended. You can set up custom environment variables as outlined in the Environment Variables documentation.

ConfirmModal

Used to request user for action confirmation, e.g. deleting items. Triggers provided 'onConfirm' callback.

Usage

<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')} />
NameDescriptionDefault
isOpen*
Toggle modal's open/closed state
boolean
-
title*
Title for the modal header
string
-
body*
Modal content
ReactNode
-
description
Modal description
ReactNode
-
confirmText*
Text for confirm button
string
-
confirmVariant
Variant for confirm button
"primary""secondary""destructive""success"
"destructive"
dismissText
Text for dismiss button
string
"Cancel"
dismissVariant
Variant for dismiss button
"primary""secondary""destructive""success"
"secondary"
icon
Icon for the modal header
"play""google""microsoft""github""gitlab""okta""discord""hipchat"
"exclamation-triangle"
modalClass
Additional styling for modal container
string
-
confirmationText
Text user needs to fill in before confirming
string
-
alternativeText
Text for alternative button
string
-
confirmButtonVariant
Confirm button variant
"primary""secondary""destructive""success"
"destructive"
onConfirm*

Confirm action callback Return a promise to disable the confirm button until the promise is resolved

() => void | Promise<void>
-
onDismiss*
Dismiss action callback
() => void
-
onAlternative
Alternative action callback
(() => void)
-
disabled
Disable the confirm button and the confirm text input if needed
boolean
-