You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
import styles from '@patternfly/react-styles/css/components/Wizard/wizard';
36
36
37
-
PatternFly has two implementations of a `Wizard`.
38
-
39
-
This newer `Wizard` takes a more explicit and declarative approach compared to the older implementation, which can be found under the [React](/components/wizard/react) tab.
40
-
41
-
## Composable structure
42
-
43
-
The standard sub-component relationships are arranged as follows:
44
-
45
-
```noLive
46
-
<Wizard>
47
-
<WizardStep />
48
-
<WizardStep
49
-
steps={[
50
-
<WizardStep />,
51
-
<WizardStep />
52
-
]}
53
-
/>
54
-
</Wizard>
55
-
```
37
+
PatternFly has two implementations of a `Wizard`. This newer `Wizard` takes a more explicit and declarative approach compared to the older implementation, which can be found under the [React](/components/wizard/react) tab.
56
38
57
39
## Examples
58
40
@@ -61,14 +43,42 @@ The standard sub-component relationships are arranged as follows:
61
43
```ts file="./WizardBasic.tsx"
62
44
```
63
45
64
-
### Custom Nav
46
+
### Custom navigation
65
47
66
48
```ts file="./WizardCustomNav.tsx"
67
49
```
68
50
69
-
### Kitchen Sink
51
+
### Kitchen sink
70
52
71
53
Includes a header, custom footer, sub-steps, step content with a drawer, custom nav item, and nav prevention until step visitation.
72
54
73
55
```ts file="./WizardKitchenSink.tsx"
74
56
```
57
+
58
+
## Hooks
59
+
60
+
### useWizardFooter
61
+
62
+
Used to set a unique footer for the wizard on any given step. See step 3 of [Kitchen sink](#kitchen-sink) for a live example.
63
+
64
+
```noLive
65
+
import { useWizardFooter } from '@patternfly/react-core/next';
66
+
67
+
const StepContent = () => {
68
+
useWizardFooter(<>Some footer</>);
69
+
return <>Step content</>;
70
+
}
71
+
```
72
+
73
+
### useWizardContext
74
+
75
+
Used to access any property of [WizardContext](#wizardcontextprops):
76
+
77
+
```noLive
78
+
import { useWizardContext } from '@patternfly/react-core/next';
79
+
80
+
const StepContent = () => {
81
+
const { activeStep } = useWizardContext();
82
+
return <>This is the active step: {activeStep}</>;
0 commit comments