| section | Component groups | ||||
|---|---|---|---|---|---|
| subsection | Content containers | ||||
| id | Deck | ||||
| source | react | ||||
| propComponents |
|
||||
| sourceLink | https://github.com/patternfly/react-component-groups/blob/main/packages/module/patternfly-docs/content/extensions/component-groups/examples/Deck/Deck.md |
import Deck from '@patternfly/react-component-groups/dist/dynamic/Deck'; import { ModalDeck } from '@patternfly/react-component-groups/dist/dynamic/ModalDeck'; import { FunctionComponent, useState } from 'react';
The deck component is a compact, sequential container for presenting a suite of static announcements or an informational walkthrough. It is not intended for task completion or form-filling workflows.
This example demonstrates the basic deck with automatic navigation. Buttons can use the navigation prop to automatically handle page changes:
navigation: 'next'- Advances to the next pagenavigation: 'previous'- Goes back to the previous pagenavigation: 'close'- Triggers the onClose callback
You can also add custom onClick handlers for analytics, validation, or other logic. The custom onClick will be called before the automatic navigation occurs.
Display the deck in a modal dialog. The ModalDeck component wraps the Deck in a PatternFly Modal without a close button or extra padding, ideal for guided walkthroughs that require user interaction.