Layout

ModalWizard

A Modal Wizard is a collection of Modals that user can interact with to display any information step by step
1
import {Box, Button, ModalWizard} from '@coveord/plasma-mantine';
2
import {useState} from 'react';
3
4
const Demo = () => {
5
const [opened, setOpened] = useState(false);
6
7
return (
8
<>
9
<Button onClick={() => setOpened(true)}> Open ModalWizard </Button>
10
<ModalWizard onClose={() => setOpened(false)} opened={opened} onFinish={() => setOpened(false)}>
11
<ModalWizard.Step
12
docLink="https://coveo.com"
13
title="Current Step is 1"
14
showProgressBar={false}
15
countsAsProgress={false}
16
description="Description of step 1"
17
validateStep={() => ({isValid: true})}
18
docLinkTooltipLabel="Tooltip label"
19
>
20
<Box mih={300}>Slide 1</Box>
21
</ModalWizard.Step>
22
<ModalWizard.Step
23
docLink="https://coveo.com"
24
title="Current Step is 2"
25
description="Description of step 2"
26
validateStep={() => ({isValid: true})}
27
docLinkTooltipLabel="Tooltip label"
28
>
29
<Box mih={300}>Slide 2</Box>
30
</ModalWizard.Step>
31
<ModalWizard.Step
32
docLink="https://coveo.com"
33
title="Current Step is 3"
34
description="Description of step 3"
35
validateStep={() => ({isValid: true})}
36
docLinkTooltipLabel="Tooltip label"
37
>
38
<Box mih={300}>Slide 3</Box>
39
</ModalWizard.Step>
40
</ModalWizard>
41
</>
42
);
43
};
44
export default Demo;

Props

NameTypeDefaultDescription
onCloserequired() => void
Called when modal/drawer is closed
openedrequiredboolean
Determines whether modal/drawer is opened
"aria-activedescendant"string
Identifies the currently active element when DOM focus is on a composite widget, textbox, group, or application.
"aria-atomic"Booleanish
Indicates whether assistive technologies will present all, or only parts of, the changed region based on the change notifications defined by the aria-relevant attribute.
"aria-autocomplete""none" | "inline" | "list" | "both"
Indicates whether inputting text could trigger display of one or more predictions of the user's intended value for an input and specifies how predictions would be presented if they are made.
"aria-braillelabel"string
Defines a string value that labels the current element, which is intended to be converted into Braille.
"aria-brailleroledescription"string
Defines a human-readable, author-localized abbreviated description for the role of an element, which is intended to be converted into Braille.
"aria-busy"Booleanish
"aria-checked"boolean | "true" | "false" | "mixed"
Indicates the current "checked" state of checkboxes, radio buttons, and other widgets.
"aria-colcount"number
Defines the total number of columns in a table, grid, or treegrid.
"aria-colindex"number
Defines an element's column index or position with respect to the total number of columns within a table, grid, or treegrid.
"aria-colindextext"string
Defines a human readable text alternative of aria-colindex.
"aria-colspan"number
Defines the number of columns spanned by a cell or gridcell within a table, grid, or treegrid.
"aria-controls"string
Identifies the element (or elements) whose contents or presence are controlled by the current element.
"aria-current"boolean | "time" | "true" | "false" | "page" | "step" | "location" | "date"
Indicates the element that represents the current item within a container or set of related elements.
"aria-describedby"string
Identifies the element (or elements) that describes the object.
"aria-description"string
Defines a string value that describes or annotates the current element.
"aria-details"string
Identifies the element that provides a detailed, extended description for the object.
"aria-disabled"Booleanish
Indicates that the element is perceivable but disabled, so it is not editable or otherwise operable.
"aria-errormessage"string
Identifies the element that provides an error message for the object.
"aria-expanded"Booleanish
Indicates whether the element, or another grouping element it controls, is currently expanded or collapsed.
"aria-flowto"string
Identifies the next element (or elements) in an alternate reading order of content which, at the user's discretion, allows assistive technology to override the general default of reading in document source order.
"aria-haspopup"boolean | "dialog" | "menu" | "true" | "false" | "listbox" | "tree" | "grid"
Indicates the availability and type of interactive popup element, such as menu or dialog, that can be triggered by an element.
"aria-hidden"Booleanish
Indicates whether the element is exposed to an accessibility API.
"aria-invalid"boolean | "true" | "false" | "grammar" | "spelling"
Indicates the entered value does not conform to the format expected by the application.
"aria-keyshortcuts"string
Indicates keyboard shortcuts that an author has implemented to activate or give focus to an element.
"aria-label"string
Defines a string value that labels the current element.
"aria-labelledby"string
Identifies the element (or elements) that labels the current element.
"aria-level"number
Defines the hierarchical level of an element within a structure.
"aria-live""off" | "assertive" | "polite"
Indicates that an element will be updated, and describes the types of updates the user agents, assistive technologies, and user can expect from the live region.
"aria-modal"Booleanish
Indicates whether an element is modal when displayed.
"aria-multiline"Booleanish
Indicates whether a text box accepts multiple lines of input or only a single line.
"aria-multiselectable"Booleanish
Indicates that the user may select more than one item from the current selectable descendants.
"aria-orientation""horizontal" | "vertical"
Indicates whether the element's orientation is horizontal, vertical, or unknown/ambiguous.
"aria-owns"string
Identifies an element (or elements) in order to define a visual, functional, or contextual parent/child relationship between DOM elements where the DOM hierarchy cannot be used to represent the relationship.
"aria-placeholder"string
Defines a short hint (a word or short phrase) intended to aid the user with data entry when the control has no value. A hint could be a sample value or a brief description of the expected format.
"aria-posinset"number
Defines an element's number or position in the current set of listitems or treeitems. Not required if all elements in the set are present in the DOM.
"aria-pressed"boolean | "true" | "false" | "mixed"
Indicates the current "pressed" state of toggle buttons.
"aria-readonly"Booleanish
Indicates that the element is not editable, but is otherwise operable.
"aria-relevant""text" | "additions" | "additions removals" | "additions text" | "all" | "removals" | "removals additions" | "removals text" | "text additions" | "text removals"
Indicates what notifications the user agent will trigger when the accessibility tree within a live region is modified.
"aria-required"Booleanish
Indicates that user input is required on the element before a form may be submitted.
"aria-roledescription"string
Defines a human-readable, author-localized description for the role of an element.
"aria-rowcount"number
Defines the total number of rows in a table, grid, or treegrid.
"aria-rowindex"number
Defines an element's row index or position with respect to the total number of rows within a table, grid, or treegrid.
"aria-rowindextext"string
Defines a human readable text alternative of aria-rowindex.
"aria-rowspan"number
Defines the number of rows spanned by a cell or gridcell within a table, grid, or treegrid.
"aria-selected"Booleanish
Indicates the current "selected" state of various widgets.
"aria-setsize"number
Defines the number of items in the current set of listitems or treeitems. Not required if all elements in the set are present in the DOM.
"aria-sort""none" | "ascending" | "descending" | "other"
Indicates if items in a table or grid are sorted in ascending or descending order.
"aria-valuemax"number
Defines the maximum allowed value for a range widget.
"aria-valuemin"number
Defines the minimum allowed value for a range widget.
"aria-valuenow"number
Defines the current value for a range widget.
"aria-valuetext"string
Defines the human readable text alternative of aria-valuenow for a range widget.
aboutstring
accessKeystring
autoCapitalizestring
autoCorrectstring
autoFocusboolean
autoSavestring
cancelButtonLabelstring"Cancel"
The label of the cancel button
childrenReactNode[]
Children to display in modal wizard
classNamestring
classNamesClassNames<any>
closeButtonPropsModalBaseCloseButtonProps
Props added to close button
closeOnClickOutsideboolean
Determines whether the modal/drawer should be closed when user clicks on the overlay, true by default
closeOnEscapeboolean
Determines whether onClose should be called when user presses escape key, true by default
colorstring
contentstring
contentEditableBooleanish | "inherit"
contextMenustring
dangerouslySetInnerHTML{ __html: string | TrustedHTML; }
datatypestring
defaultCheckedboolean
defaultValuestring | number | readonly string[]
dirstring
draggableBooleanish
finishButtonLabelstring"Finish"
The label of the finish button
fullScreenboolean
Determines whether the modal should take the entire screen
handleDirtyState() => boolean
A function to confirm close if the state is dirty before closing
hiddenboolean
idstring
Id used to connect modal/drawer with body and title
inlistany
inputMode"search" | "text" | "none" | "tel" | "url" | "email" | "numeric" | "decimal"
Hints at the type of data that might be entered by the user while editing the element or its contents
isstring
Specify that a standard HTML element should behave like a defined custom built-in element
isDirty() => boolean
Determine if user interacted with any steps in the modal wizard
isStepValidatedOnNextbooleanfalse
Indicates if step validation should be performed when clicking on to the next step If true, the next step will always be enabled
itemIDstring
itemPropstring
itemRefstring
itemScopeboolean
itemTypestring
keepMountedboolean
If set modal/drawer will not be unmounted from the DOM when it is hidden, display: none styles will be added instead
keyKey
langstring
lockScrollboolean
Determines whether scroll should be locked when opened={true}, defaults to true
nextButtonLabelstring"Next"
The label of the next button
noncestring
onAbortReactEventHandler<HTMLDivElement>
onAbortCaptureReactEventHandler<HTMLDivElement>
onAnimationEndAnimationEventHandler<HTMLDivElement>
onAnimationEndCaptureAnimationEventHandler<HTMLDivElement>
onAnimationIterationAnimationEventHandler<HTMLDivElement>
onAnimationIterationCaptureAnimationEventHandler<HTMLDivElement>
onAnimationStartAnimationEventHandler<HTMLDivElement>
onAnimationStartCaptureAnimationEventHandler<HTMLDivElement>
onAuxClickMouseEventHandler<HTMLDivElement>
onAuxClickCaptureMouseEventHandler<HTMLDivElement>
onBeforeInputFormEventHandler<HTMLDivElement>
onBeforeInputCaptureFormEventHandler<HTMLDivElement>
onBlurFocusEventHandler<HTMLDivElement>
onBlurCaptureFocusEventHandler<HTMLDivElement>
onCanPlayReactEventHandler<HTMLDivElement>
onCanPlayCaptureReactEventHandler<HTMLDivElement>
onCanPlayThroughReactEventHandler<HTMLDivElement>
onCanPlayThroughCaptureReactEventHandler<HTMLDivElement>
onChangeFormEventHandler<HTMLDivElement>
onChangeCaptureFormEventHandler<HTMLDivElement>
onClickMouseEventHandler<HTMLDivElement>
onClickCaptureMouseEventHandler<HTMLDivElement>
onCompositionEndCompositionEventHandler<HTMLDivElement>
onCompositionEndCaptureCompositionEventHandler<HTMLDivElement>
onCompositionStartCompositionEventHandler<HTMLDivElement>
onCompositionStartCaptureCompositionEventHandler<HTMLDivElement>
onCompositionUpdateCompositionEventHandler<HTMLDivElement>
onCompositionUpdateCaptureCompositionEventHandler<HTMLDivElement>
onContextMenuMouseEventHandler<HTMLDivElement>
onContextMenuCaptureMouseEventHandler<HTMLDivElement>
onCopyClipboardEventHandler<HTMLDivElement>
onCopyCaptureClipboardEventHandler<HTMLDivElement>
onCutClipboardEventHandler<HTMLDivElement>
onCutCaptureClipboardEventHandler<HTMLDivElement>
onDoubleClickMouseEventHandler<HTMLDivElement>
onDoubleClickCaptureMouseEventHandler<HTMLDivElement>
onDragDragEventHandler<HTMLDivElement>
onDragCaptureDragEventHandler<HTMLDivElement>
onDragEndDragEventHandler<HTMLDivElement>
onDragEndCaptureDragEventHandler<HTMLDivElement>
onDragEnterDragEventHandler<HTMLDivElement>
onDragEnterCaptureDragEventHandler<HTMLDivElement>
onDragExitDragEventHandler<HTMLDivElement>
onDragExitCaptureDragEventHandler<HTMLDivElement>
onDragLeaveDragEventHandler<HTMLDivElement>
onDragLeaveCaptureDragEventHandler<HTMLDivElement>
onDragOverDragEventHandler<HTMLDivElement>
onDragOverCaptureDragEventHandler<HTMLDivElement>
onDragStartDragEventHandler<HTMLDivElement>
onDragStartCaptureDragEventHandler<HTMLDivElement>
onDropDragEventHandler<HTMLDivElement>
onDropCaptureDragEventHandler<HTMLDivElement>
onDurationChangeReactEventHandler<HTMLDivElement>
onDurationChangeCaptureReactEventHandler<HTMLDivElement>
onEmptiedReactEventHandler<HTMLDivElement>
onEmptiedCaptureReactEventHandler<HTMLDivElement>
onEncryptedReactEventHandler<HTMLDivElement>
onEncryptedCaptureReactEventHandler<HTMLDivElement>
onEndedReactEventHandler<HTMLDivElement>
onEndedCaptureReactEventHandler<HTMLDivElement>
onErrorReactEventHandler<HTMLDivElement>
onErrorCaptureReactEventHandler<HTMLDivElement>
onFinish() => unknown
A function that is executed when user completes all the steps.
  • closeA function that closes the modal when called.
onFocusFocusEventHandler<HTMLDivElement>
onFocusCaptureFocusEventHandler<HTMLDivElement>
onGotPointerCapturePointerEventHandler<HTMLDivElement>
onGotPointerCaptureCapturePointerEventHandler<HTMLDivElement>
onInputFormEventHandler<HTMLDivElement>
onInputCaptureFormEventHandler<HTMLDivElement>
onInvalidFormEventHandler<HTMLDivElement>
onInvalidCaptureFormEventHandler<HTMLDivElement>
onKeyDownKeyboardEventHandler<HTMLDivElement>
onKeyDownCaptureKeyboardEventHandler<HTMLDivElement>
onKeyUpKeyboardEventHandler<HTMLDivElement>
onKeyUpCaptureKeyboardEventHandler<HTMLDivElement>
onLoadReactEventHandler<HTMLDivElement>
onLoadCaptureReactEventHandler<HTMLDivElement>
onLoadedDataReactEventHandler<HTMLDivElement>
onLoadedDataCaptureReactEventHandler<HTMLDivElement>
onLoadedMetadataReactEventHandler<HTMLDivElement>
onLoadedMetadataCaptureReactEventHandler<HTMLDivElement>
onLoadStartReactEventHandler<HTMLDivElement>
onLoadStartCaptureReactEventHandler<HTMLDivElement>
onLostPointerCapturePointerEventHandler<HTMLDivElement>
onLostPointerCaptureCapturePointerEventHandler<HTMLDivElement>
onMouseDownMouseEventHandler<HTMLDivElement>
onMouseDownCaptureMouseEventHandler<HTMLDivElement>
onMouseEnterMouseEventHandler<HTMLDivElement>
onMouseLeaveMouseEventHandler<HTMLDivElement>
onMouseMoveMouseEventHandler<HTMLDivElement>
onMouseMoveCaptureMouseEventHandler<HTMLDivElement>
onMouseOutMouseEventHandler<HTMLDivElement>
onMouseOutCaptureMouseEventHandler<HTMLDivElement>
onMouseOverMouseEventHandler<HTMLDivElement>
onMouseOverCaptureMouseEventHandler<HTMLDivElement>
onMouseUpMouseEventHandler<HTMLDivElement>
onMouseUpCaptureMouseEventHandler<HTMLDivElement>
onNext(newStep: number, setCurrentStep?: Dispatch<number>) => unknown
A callback function that is executed when the user clicks on the next button
onPasteClipboardEventHandler<HTMLDivElement>
onPasteCaptureClipboardEventHandler<HTMLDivElement>
onPauseReactEventHandler<HTMLDivElement>
onPauseCaptureReactEventHandler<HTMLDivElement>
onPlayReactEventHandler<HTMLDivElement>
onPlayCaptureReactEventHandler<HTMLDivElement>
onPlayingReactEventHandler<HTMLDivElement>
onPlayingCaptureReactEventHandler<HTMLDivElement>
onPointerCancelPointerEventHandler<HTMLDivElement>
onPointerCancelCapturePointerEventHandler<HTMLDivElement>
onPointerDownPointerEventHandler<HTMLDivElement>
onPointerDownCapturePointerEventHandler<HTMLDivElement>
onPointerEnterPointerEventHandler<HTMLDivElement>
onPointerEnterCapturePointerEventHandler<HTMLDivElement>
onPointerLeavePointerEventHandler<HTMLDivElement>
onPointerLeaveCapturePointerEventHandler<HTMLDivElement>
onPointerMovePointerEventHandler<HTMLDivElement>
onPointerMoveCapturePointerEventHandler<HTMLDivElement>
onPointerOutPointerEventHandler<HTMLDivElement>
onPointerOutCapturePointerEventHandler<HTMLDivElement>
onPointerOverPointerEventHandler<HTMLDivElement>
onPointerOverCapturePointerEventHandler<HTMLDivElement>
onPointerUpPointerEventHandler<HTMLDivElement>
onPointerUpCapturePointerEventHandler<HTMLDivElement>
onPrevious(newStep: number) => unknown
A callback function that is executed when the user clicks on the previous button
onProgressReactEventHandler<HTMLDivElement>
onProgressCaptureReactEventHandler<HTMLDivElement>
onRateChangeReactEventHandler<HTMLDivElement>
onRateChangeCaptureReactEventHandler<HTMLDivElement>
onResetFormEventHandler<HTMLDivElement>
onResetCaptureFormEventHandler<HTMLDivElement>
onResizeReactEventHandler<HTMLDivElement>
onResizeCaptureReactEventHandler<HTMLDivElement>
onScrollUIEventHandler<HTMLDivElement>
onScrollCaptureUIEventHandler<HTMLDivElement>
onSeekedReactEventHandler<HTMLDivElement>
onSeekedCaptureReactEventHandler<HTMLDivElement>
onSeekingReactEventHandler<HTMLDivElement>
onSeekingCaptureReactEventHandler<HTMLDivElement>
onSelectReactEventHandler<HTMLDivElement>
onSelectCaptureReactEventHandler<HTMLDivElement>
onStalledReactEventHandler<HTMLDivElement>
onStalledCaptureReactEventHandler<HTMLDivElement>
onSubmitFormEventHandler<HTMLDivElement>
onSubmitCaptureFormEventHandler<HTMLDivElement>
onSuspendReactEventHandler<HTMLDivElement>
onSuspendCaptureReactEventHandler<HTMLDivElement>
onTimeUpdateReactEventHandler<HTMLDivElement>
onTimeUpdateCaptureReactEventHandler<HTMLDivElement>
onTouchCancelTouchEventHandler<HTMLDivElement>
onTouchCancelCaptureTouchEventHandler<HTMLDivElement>
onTouchEndTouchEventHandler<HTMLDivElement>
onTouchEndCaptureTouchEventHandler<HTMLDivElement>
onTouchMoveTouchEventHandler<HTMLDivElement>
onTouchMoveCaptureTouchEventHandler<HTMLDivElement>
onTouchStartTouchEventHandler<HTMLDivElement>
onTouchStartCaptureTouchEventHandler<HTMLDivElement>
onTransitionEndTransitionEventHandler<HTMLDivElement>
onTransitionEndCaptureTransitionEventHandler<HTMLDivElement>
onVolumeChangeReactEventHandler<HTMLDivElement>
onVolumeChangeCaptureReactEventHandler<HTMLDivElement>
onWaitingReactEventHandler<HTMLDivElement>
onWaitingCaptureReactEventHandler<HTMLDivElement>
onWheelWheelEventHandler<HTMLDivElement>
onWheelCaptureWheelEventHandler<HTMLDivElement>
overlayPropsModalBaseOverlayProps
Props added to Overlay component, use configure opacity, background color, styles and other properties
paddingMantineNumberSize
Key of theme.spacing or any valid CSS value to set content, header and footer padding, 'md' by default
placeholderstring
portalPropsOmit<PortalProps, "children" | "withinPortal" | "target">
Props to pass down to the portal when withinPortal is true
prefixstring
previousButtonLabelstring"Previous"
The label of the previous button
propertystring
radioGroupstring
radiusMantineNumberSize
Key of theme.radius or any valid CSS value to set border-radius, theme.defaultRadius by default
relstring
resourcestring
resultsnumber
returnFocusboolean
Determines whether focus should be returned to the last active element onClose is called, true by default
revstring
roleAriaRole
scrollAreaComponentScrollAreaComponent
Scroll area component, ScrollArea.Autosize by default
securitystring
shadowMantineShadow
Key of theme.shadows or any valid css box-shadow value, 'xl' by default
sizeMantineNumberSize
Controls content width, 'md' by default
slotstring
spellCheckBooleanish
styleCSSProperties
stylesStyles<any>
suppressContentEditableWarningboolean
suppressHydrationWarningboolean
tabIndexnumber
targetstring | HTMLElement
Target element or selector where Portal should be rendered, by default new element is created and appended to the document.body
transitionPropsPartial<Omit<TransitionProps, "mounted">>
Props added to Transition component that used to animate overlay and body, use to configure duration and animation type, { duration: 200, transition: 'pop' } by default
translate"yes" | "no"
trapFocusboolean
Determines whether focus should be trapped, true by default
typeofstring
unselectable"off" | "on"
unstyledboolean
variantstring
vocabstring
withCloseButtonboolean
Determines whether close button should be rendered, true by default
withinPortalboolean
Determines whether component should be rendered inside Portal, true by default
withOverlayboolean
Determines whether overlay should be rendered, true by default
xOffsetany
Left/right modal offset, 5vw by default
yOffsetany
Top/bottom modal offset, 5vh by default
zIndexnumber
z-index CSS property of root element, 200 by default
"aria-dropeffect"deprecated"link" | "none" | "copy" | "execute" | "move" | "popup"
in ARIA 1.1
Indicates what functions can be performed when a dragged object is released on the drop target.
"aria-grabbed"deprecatedBooleanish
in ARIA 1.1
Indicates an element's "grabbed" state in a drag-and-drop operation.
onKeyPressdeprecatedKeyboardEventHandler<HTMLDivElement>
onKeyPressCapturedeprecatedKeyboardEventHandler<HTMLDivElement>

Examples

Modal Wizard with Form Validation
1
import {Button, Flex, ModalWizard, ModalWizardStepProps, TextInput, Title, useForm} from '@coveord/plasma-mantine';
2
import {useState} from 'react';
3
4
export default () => {
5
const [opened, setOpened] = useState(false);
6
7
const form = useForm({
8
initialValues: {
9
firstName: '',
10
lastName: '',
11
},
12
validate: {
13
firstName: (value) => (value.length < 2 ? 'Minimum 2 characters required' : null),
14
lastName: (value) => (value.length < 2 ? 'Minimum 2 characters required' : null),
15
},
16
});
17
18
const Steps: Array<Omit<ModalWizardStepProps, 'children'> & {element: JSX.Element}> = [
19
{
20
docLink: 'https://coveo.com',
21
title: 'Current Step is 1',
22
docLinkTooltipLabel: 'Tooltip label',
23
element: (
24
<Flex direction="column" gap="sm">
25
<Title order={5}>First Name</Title>
26
27
<TextInput {...form.getInputProps('firstName')} placeholder="Enter first name" />
28
</Flex>
29
),
30
},
31
{
32
docLink: 'https://coveo.com',
33
title: 'Current Step is 2',
34
docLinkTooltipLabel: 'Tooltip label',
35
element: (
36
<Flex direction="column" gap="sm">
37
<Title order={5}>Last Name</Title>
38
<TextInput {...form.getInputProps('lastName')} placeholder="Enter last name" />
39
</Flex>
40
),
41
},
42
];
43
44
return (
45
<>
46
<Button m="md" onClick={() => setOpened(true)}>
47
Open ModalWizard
48
</Button>
49
<ModalWizard
50
isStepValidatedOnNext
51
size="sm"
52
onClose={() => {
53
setOpened(false);
54
form.reset();
55
}}
56
opened={opened}
57
onFinish={async () => {
58
form.validateField('lastName');
59
if (form.isValid('lastName') && form.isDirty('lastName')) {
60
setOpened(false);
61
form.reset();
62
}
63
}}
64
onNext={async (newStepIndex, setCurrentStepIndex) => {
65
form.validateField('firstName');
66
if (form.isValid('firstName') && form.isDirty('firstName')) {
67
setCurrentStepIndex(newStepIndex);
68
}
69
}}
70
>
71
{Steps.map((step, index) => (
72
<ModalWizard.Step
73
key={index}
74
docLink={step.docLink}
75
title={step.title}
76
description={step.description}
77
showProgressBar={step.showProgressBar}
78
countsAsProgress={step.countsAsProgress}
79
>
80
{step.element}
81
</ModalWizard.Step>
82
))}
83
</ModalWizard>
84
</>
85
);
86
};
Modal Wizard with tooltip on next button
1
import {Box, Button, ModalWizard} from '@coveord/plasma-mantine';
2
import {useState} from 'react';
3
4
export default () => {
5
const [opened, setOpened] = useState(false);
6
7
return (
8
<>
9
<Button m="md" onClick={() => setOpened(true)}>
10
Open Modal Wizard
11
</Button>
12
<ModalWizard onClose={() => setOpened(false)} opened={opened} onFinish={() => setOpened(false)}>
13
<ModalWizard.Step
14
docLink="https://coveo.com"
15
title="Current Step is 1"
16
showProgressBar={false}
17
countsAsProgress={false}
18
description="Description of step 1"
19
validateStep={() => ({isValid: true})}
20
docLinkTooltipLabel="Tooltip label"
21
>
22
<Box mih={300}>Slide 1</Box>
23
</ModalWizard.Step>
24
<ModalWizard.Step
25
docLink="https://coveo.com"
26
title="Current Step is 2"
27
description="Description of step 2"
28
validateStep={() => ({isValid: false})}
29
docLinkTooltipLabel="Tooltip label"
30
disabledTooltipLabel="Tooltip label on disabled button"
31
>
32
<Box mih={300}>Slide 2</Box>
33
</ModalWizard.Step>
34
</ModalWizard>
35
</>
36
);
37
};

No guidelines exist for ModalWizard yet.

Create guidelines