frame: true
noPadding: true
height: 400
---
<Takeover
    title="Takeover Title"
    backLabel="Previous Page"
    footer={
        <ButtonGroup>
            <Button>Cancel</Button>
            <Button primary>Continue</Button>
        </ButtonGroup>
    }
    onBack={function(){ return;}}
    onClose={function(){ return;}}
>
    Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean id accumsan augue. Phasellus consequat augue vitae tellus tincidunt posuere. Curabitur justo urna, consectetur vel elit iaculis, ultrices condimentum risus. Nulla facilisi. Etiam venenatis molestie tellus. Quisque consectetur non risus eu rutrum.
</Takeover>

Multiple Content Sections

A Takeover can contain multiple content sections that span the width of the screen. These are useful for including navigation indicators like a Progress Tracker or other meta information about the page content.

frame: true
noPadding: true
height: 400
---
const MultipleContentSections = () => {
    const [index, setIndex] = React.useState(0)
    const longContent = () => (
        <Form>
            <Form.Group widths="equal">
                    <Form.Input placeholder="First data goes here..." label="Data #1" />
                    <Form.Input placeholder="Second data goes here..." label="Data #2" />
            </Form.Group>
            <Form.Input placeholder="Third data goes here..." label="Data #3" />
            <Form.ButtonToggle
                label="Toggle"
                options={[
                    {
                            text: 'Yes',
                            value: 'Yes',
                            selected: true
                    },
                    {
                            text: 'No',
                            value: 'No'
                    }
                ]}
            />
            <Form.Group widths="equal">
                    <Form.Input placeholder="Fourth data goes here..." label="Data #4" />
                    <Form.Input placeholder="Fifth data goes here..." label="Data #5" />
            </Form.Group>
            <Form.Input placeholder="Sixth data goes here..." label="Data #6" />
            <Form.ButtonToggle
                label="Toggle"
                options={[
                    {
                            text: 'Yes',
                            value: 'Yes',
                            selected: true
                    },
                    {
                            text: 'No',
                            value: 'No'
                    }
                ]}
            />
            <Form.Group widths="equal">
                    <Form.Input placeholder="Seventh data goes here..." label="Data #7" />
                    <Form.Input placeholder="Eighth data goes here..." label="Data #8" />
            </Form.Group>
            <Form.Input placeholder="Nineth data goes here..." label="Data #9" />
            <Form.ButtonToggle
                label="Toggle"
                options={[
                    {
                            text: 'Yes',
                            value: 'Yes',
                            selected: true
                    },
                    {
                            text: 'No',
                            value: 'No'
                    }
                ]}
            />
        </Form>
    )
    return (
        <Takeover
            title="Takeover Title"
            backLabel="Previous Page"
            complete={index === 4}
            footer={
                index < 4 && (
                    <Stack justifyContent="space-between" direction="row-reverse" className="w-100">
                        <ButtonGroup>
                            <Button>Cancel</Button>
                            <Button primary onClick={() => setIndex(index + 1)}>{index < 3 ? 'Continue' : 'Complete'}</Button>
                        </ButtonGroup>
                        {index > 0 && <Button fill="subtle" onClick={() => setIndex(index - 1)}>Back</Button>}
                    </Stack>
                )
            }
            onBack={function(){ return;}}
            onClose={function(){ return;}}
            sectioned={true}
            contentWrapperClass="d-f flex-column"
        >
            <Takeover.Section>
                <ProgressTracker currentIndex={index}>
                    <ProgressTracker.Step />
                    <ProgressTracker.Step />
                    <ProgressTracker.Step />
                    <ProgressTracker.Step />
                </ProgressTracker>
            </Takeover.Section>
            {(index === 0 || index === 2) &&
                <Takeover.Section className="of-auto">
                    {longContent()}
                </Takeover.Section>
            }
            {(index === 1 || index === 3) &&
                <Takeover.Section className="of-auto">
                    Hello World
                </Takeover.Section>
            }
        </Takeover>
    )
}
render (MultipleContentSections)

Light Theme

A takeover can also be in a light theme. This variation is useful when visualizing a context change to a user, such as with Takeovers within Takeovers.

frame: true
noPadding: true
height: 400
---
<Takeover
    title="Takeover Title"
    theme="light"
    backLabel="Previous Page"
    footer={
        <ButtonGroup>
            <Button>Cancel</Button>
            <Button primary>Continue</Button>
        </ButtonGroup>
    }
    onBack={function(){ return;}}
    onClose={function(){ return;}}
>
    Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean id accumsan augue. Phasellus consequat augue vitae tellus tincidunt posuere. Curabitur justo urna, consectetur vel elit iaculis, ultrices condimentum risus. Nulla facilisi. Etiam venenatis molestie tellus. Quisque consectetur non risus eu rutrum.
</Takeover>

Takeover Header Actions

There are times where a Takeover has actions that can be performed on the content that aren't specific to moving backward or forward in a flow. These Takeover Actions can be added to the header of the Takeover.

frame: true
noPadding: true
height: 400
---
<Takeover
    title="Takeover Title"
    footer={
        <ButtonGroup>
            <Button>Cancel</Button>
            <Button primary>Continue</Button>
        </ButtonGroup>
    }
    onBack={function(){ return;}}
    onClose={function(){ return;}}
    actions={
        <Dropdown
            trigger={<Button small iconName="expand_more" iconPosition="right">Actions</Button>}
            icon={null}
        >
            <Dropdown.Menu>
                <Dropdown.Item text="Print" />
                <Dropdown.Item text="Download" />
            </Dropdown.Menu>
        </Dropdown>
    }
>
    Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean id accumsan augue. Phasellus consequat augue vitae tellus tincidunt posuere. Curabitur justo urna, consectetur vel elit iaculis, ultrices condimentum risus. Nulla facilisi. Etiam venenatis molestie tellus. Quisque consectetur non risus eu rutrum.
</Takeover>

Takeover Footer

Takeover footers generally provide flow controls such as backward, forward, and submit. Like the modal, the footer layout can be customized for different needs.

frame: true
noPadding: true
height: 200
---
<Takeover
    title="Single Right Aligned Button"
    footer={<Button primary>Save</Button>}
    theme="light"
>
</Takeover>
frame: true
noPadding: true
height: 400
---
<Takeover
    title="Double Right Aligned Buttons"
    footer={<ButtonGroup>
        <Button>Cancel</Button>
        <Button primary>Save</Button>
    </ButtonGroup>}
    theme="light"
>
</Takeover>
frame: true
noPadding: true
height: 400
---
<Takeover
    title="Centered Button"
    footer={<Button>Close</Button>}
    footerAlign="center"
    theme="light"
>
</Takeover>
frame: true
noPadding: true
height: 400
---
<Takeover
    title="Split Buttons"
    footer={<React.Fragment>
        <Button>Cancel</Button>
        <Button primary>Save</Button>
    </React.Fragment>}
    footerAlign="space-between"
    theme="light"
>
</Takeover>

Custom Title

frame: true
noPadding: true
height: 200
---
<Takeover
    title={
        <Stack alignItems="center" spacing="1">
            <Headline className="c-white m-b-0">
                <span className="c-neutral-80">Edit Audience:</span> Acquire - $250k and up
            </Headline>
            <Icon name="edit" className="c-neutral-80 cursor-pointer" size={16} />
        </Stack>
    }
>
</Takeover>

Best Practices

A Takeover should:

  • Be used to display a multi-step workflow that does not need context of the previous page
  • Provide a title to clearly identify the content of the page
  • Include clear call-to-actions for the user to proceed, cancel, or close

Related Components

  • For more context around the page the user came from, use a Modal component.
  • For critical information that requires a specific decision, use a Dialog component.

Importing

import { Takeover } from '@servicetitan/design-system';