Basic usage
First, import the component.
import {ModalSplit} from '@pleo-io/telescope'
Then use it, like so:
API reference
| Prop | Type | Default |
|---|---|---|
allowPinchZoom | boolean | |
aria-label | string | |
aria-labelledby | string | |
children | enum | |
dangerouslyBypassFocusLock | boolean | |
dangerouslyBypassScrollLock | boolean | |
dangerouslySetZIndexValue | number | |
initialFocusRef | React.RefObject<any> | |
isOpen | boolean | |
onDismiss | function |
Direct children should be ModalSplit.Content and ModalSplit.IllustrationContainer only.
ModalSplit.Content
The container for the left hand side content of the modal.
| Prop | Type | Default |
|---|---|---|
children | enum |
ModalSplit.Body
A body container that allows long content to scroll within the modal.
| Prop | Type | Default |
|---|---|---|
children | enum |
Should contain all left hand side content of the modal except for the StepIndicator, Footer
and Actions.
ModalSplit.Title
Should be placed within ModalSplit.Body to allow for correct padding and scrolling behaviour.
ModalSplit.Text
ModalSplit.Actions
Should contain only the ModalSplit.NextButton and/or ModalSplit.BackButton.
ModalSplit.BackButton
| Prop | Type | Default |
|---|---|---|
as | any | |
destructive | boolean | |
disabled | boolean | |
download | any | |
forwardedAs | any | |
fullWidth | boolean | |
href | string | |
hrefLang | string | |
inherit | boolean | |
loading | boolean | |
loadingText | string | |
media | string | |
ping | string | |
referrerPolicy | string | |
rel | string | |
skeleton | boolean | false |
target | string | |
to | string | |
tooltipProps | Omit<TooltipProps, "children"> |
ModalSplit.NextButton
| Prop | Type | Default |
|---|---|---|
as | any | |
destructive | boolean | |
disabled | boolean | |
download | any | |
forwardedAs | any | |
fullWidth | boolean | |
href | string | |
hrefLang | string | |
IconRight | React.ComponentType | |
inherit | boolean | |
loading | boolean | |
loadingText | string | |
media | string | |
ping | string | |
referrerPolicy | string | |
rel | string | |
skeleton | boolean | false |
target | string | |
to | string | |
tooltipProps | Omit<TooltipProps, "children"> |
ModalSplit.Footer
ModalSplit.IllustrationContainer
The container for the right hand side illustration for the modal.
ModalSplit.Illustration
The container for the Illustration.
ModalSplit.Photograph
The container for the photograph shown on the modal's right half.
ModalSplit.StepIndicator
| Prop | Type | Default |
|---|---|---|
activeStep* | string | |
onClickStep | function | |
steps* | ModalSplitStep[] |
ModalSplit.Steps
| Prop | Type | Default |
|---|---|---|
activeStepId* | string |
Should be placed inside of ModalSplit.Content and contain only ModalSplit.Steps as children.
ModalSplit.Step
| Prop | Type | Default |
|---|---|---|
stepId* | string |
Should always be a direct child of a ModalSplit.Steps.
useModalSplitSteps
We expose a dedicated hook to manage the steps of the modal split.
const steps = [{stepId: 'step-1'}, {stepId: 'step-2'}] const {activeStep, setActiveStep, nextStep, previousStep} = useModalSplitSteps({ steps: steps, initialActiveStep: 'step-1', })
| Prop | Type | Default |
|---|---|---|
activeStep | string | |
setActiveStep | function | |
nextStep | function | |
previousStep | function |