WizardSheet / Dev
Install
Import
Props
WizardSheet
| Prop | Type & Description |
|---|---|
| id | string Plain id |
| header | ReactNode Add a custom header (under the step bars) To use the standard header, use the |
| headerTitle | string The title of the header Use in combination with For a custom header, use the |
| headerIcon | ReactNode Use in combination with |
| twStepHeight | string Specify the height of the steps All steps must have the same height for the wizard to work smoothly |
| noAutoPlay | boolean Default value: "false" Whether to autoplay the steps |
| autoplayDuration | number The duration of each step in milliseconds |
| steps | ReactNode[] The steps of the wizard Can be any React component, but should typically be a simple component without scrollable content. Example:
|
| twStepColors | string[] Change the color of the sheet when changing steps Give a list of colors, one for each step |
| onChangeStep | (activeStep: number) => void Callback when the active step changes @param activeStep |
| onCompleted | () => void Callback when the wizard is completed |
| accessibleStepAnnouncement | (activeStep: number, totalSteps: number, autoplaying: boolean) => string Build a custom announcement for the active step A sane default is provided @param activeStep The active step @param totalSteps The total number of steps @param autoplaying Whether the wizard is currently autoplaying |
| important | boolean If the dialog is considered important (relative to its "siblings") If set to true:
|
| show | boolean Show/hide the modal |
| onClose | () => void Calling this will close the Sheet Typically, this will call a local set state in the application. |
| nested | ReactNode Nested Dialog/Sheet/PromptScreen components |
| initialFocus | MutableRefObject<HTMLElement> A ref to an element that should receive focus first. @see https://headlessui.com/react/dialog#focus-management |
| ntdsCustomContentClass | string Internal className-tap-in for handling advanced heading configurations like in the responsible gaming modals (the dark haiti-"trapezium" ⏢) |
| closeGuard | boolean If activated, the modal will prevent the user from dismissing the modal when swiping down "optimistically" and simply animate the Sheet up to its initial position. Example: Only allow dismissal when the customer have approved the customer agreement This is only relevant for when appearing as a sheet (and not as a modal). |
| UNSAFE_header | ReactNode This feature is considered unstable. Will most likely come into play when we look at filtering in insta games |
| footer | ReactNode Placed after the content at the bottom. Will always be visible. Typically, this place is used for call-to-action buttons. |
| renderFooter | (isBottomSheet: boolean, isPointerDevice: boolean) => ReactNode Same as the
NOTE! If both the |
| absolutePositionedDecorator | (customClassNames: (className: string, options?: { roundedTop?: boolean; roundedBottom?: boolean; }) => string) => ReactNode Renders provided element outside the inner wrapper, forgoing any margin and padding Default classNames being provided are: Example:
If you don't want the rounded corner |
| twSheetHeight | string Lock the sheet height to a specific value Default is full (h-full). To make it grow with the content, use |
| twDesktopWidth | string The width of the sheet when displayed as a left/right drawer or a dialog (desktop and tablet) These settings have no effect on mobile (always full width) Default: |
| twDialogHeightPlacement | string The height of the sheet when displayed as a dialog (desktop and tablet) Default: |
| twColor | string The text and background color of the main area of the Sheet/Modal. Warning modal example: "bg-yellow-pastel" |
| twZIndex | string Override the z-index of the Sheet Default is z-1300 |
| twFooterColor | string | string[] Color to use in the footer body. If not given, the twColor-value is used instead. Typically not needed. Warning modal example: empty. |
| UNSAFE_twHeaderColor | string Color to use in the header |
| twBorderColor | string | string[] Border color to use around the header and footer Typically not needed. Warning modal example: empty. |
| twHandleColor | string | string[] The color of the Sheet "drag knob/handle" Only relevant if you change the background in twColor. Warning modal example: "bg-silver" |
| twPadding | SheetStyleOverride Padding to use for the main area of the Sheet/Modal. |
| twFooterPadding | SheetStyleOverride The padding to use for the footer. |
| childrenClassName | string Add class names to the immediate parent of the children Note: When |
| withContentStyling | boolean If set to true the content ( Use this if you don't need full control of the elements mentioned above. You can also add className Note: you have to import '@ntds/core/css/src/ntds-content.css'; |
| noHandle | boolean Hides the handle (drag knob) in the side-sheet mode |
| twBackdropBlur | string | boolean Deactivate or customise the backdrop blur effect Default: backdrop-blur-sm @see https://tailwindcss.com/docs/blur#blurring-elements |
| dismissible | boolean | ((isBottomSheet: boolean, isPointerDevice: boolean) => boolean) If set to true, a close button will be shown in the side-sheet configuration or when the bottom sheet is (rarely) shown on desktop If you need to differentiate based on the sheet mode (bottom-sheet/side-sheet) or based on if the active device is a pointer device or not, you can provide a function instead of a boolean. This function will receive two bool params that can be used to differentiate:
Important: Remember to provide an accessibleCloseButtonLabel for the close button! |
| accessibleCloseButtonLabel | string Give the close button a descriptive label for screen readers.
Used when |
| desktopMode | SheetDesktopMode How the sheet should behave on desktop (and tablet) Default: right |
| shrinkWhenInBackground | boolean If set to true, the sheet will "shrink and lift" when a nested dialog/sheet/prompt is shown. Typically only used in combination with nested Sheets. Only affects the sheet-mode. Default: |
| outsideElement | ReactNode Render an element to be a part of the dialog semantics (including focus handling) but outside the fixed container Useful for edge cases where you need full control of the z-layer. |
| render | (isBottomSheet: boolean, isPointerDevice: boolean) => ReactNode Same as the
NOTE! If both the |
default.Heading
| Prop | Type & Description |
|---|
default.Description
| Prop | Type & Description |
|---|