| 1 |
import { Fragment, useState } from 'react'; |
| 2 |
import { ProgressStepper, ProgressStep, Checkbox } from '@patternfly/react-core'; |
| 3 |
|
| 4 |
export const ProgressStepperCompact: React.FunctionComponent = () => { |
| 5 |
const [isVertical, setIsVertical] = useState(false); |
| 6 |
const [isCenterAligned, setIsCenterAligned] = useState(false); |
| 7 |
|
| 8 |
return ( |
| 9 |
<Fragment> |
| 10 |
<Checkbox |
| 11 |
label="Vertical alignment" |
| 12 |
isChecked={isVertical} |
| 13 |
onChange={(_event, checked) => setIsVertical(checked)} |
| 14 |
aria-label="Toggle compact vertical alignment" |
| 15 |
id="toggle-compact-vertical" |
| 16 |
name="toggle-compact-vertical" |
| 17 |
/> |
| 18 |
<Checkbox |
| 19 |
label="Center alignment" |
| 20 |
isChecked={isCenterAligned} |
| 21 |
onChange={(_event, checked) => setIsCenterAligned(checked)} |
| 22 |
aria-label="Toggle compact center alignment" |
| 23 |
id="toggle-compact-center" |
| 24 |
name="toggle-compact-center" |
| 25 |
/> |
| 26 |
<br /> |
| 27 |
<ProgressStepper isCompact isVertical={isVertical} isCenterAligned={isCenterAligned}> |
| 28 |
<ProgressStep |
| 29 |
variant="success" |
| 30 |
id="compact-step1" |
| 31 |
titleId="compact-step1-title" |
| 32 |
aria-label="completed step, step with success" |
| 33 |
> |
| 34 |
First step |
| 35 |
</ProgressStep> |
| 36 |
<ProgressStep |
| 37 |
variant="info" |
| 38 |
isCurrent |
| 39 |
id="compact-step2" |
| 40 |
titleId="compact-step2-title" |
| 41 |
aria-label="step with info" |
| 42 |
> |
| 43 |
Second step |
| 44 |
</ProgressStep> |
| 45 |
<ProgressStep variant="pending" id="compact-step3" titleId="compact-step3-title" aria-label="pending step"> |
| 46 |
Third step |
| 47 |
</ProgressStep> |
| 48 |
</ProgressStepper> |
| 49 |
</Fragment> |
| 50 |
); |
| 51 |
}; |