frame: true
---
<div style={{ height: '400px' }}>
    <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>
</div>

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
---
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 (
        <div style={{ height: '400px' }}>
            <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>
        </div>
    )
}
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
---
<div style={{ height: '400px' }}>
    <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>
</div>

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
---
<div style={{ height: '400px' }}>
    <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>
</div>

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
---
<div style={{ height: '200px' }}>
    <Takeover
        title="Single Right Aligned Button"
        footer={<Button primary>Save</Button>}
        theme="light"
    >
    </Takeover>
</div>
frame: true
---
<div style={{ height: '200px' }}>
    <Takeover
        title="Double Right Aligned Buttons"
        footer={<ButtonGroup>
            <Button>Cancel</Button>
            <Button primary>Save</Button>
        </ButtonGroup>}
        theme="light"
    >
    </Takeover>
</div>
frame: true
---
<div style={{ height: '200px' }}>
    <Takeover
        title="Centered Button"
        footer={<Button>Close</Button>}
        footerAlign="center"
        theme="light"
    >
    </Takeover>
</div>
frame: true
---
<div style={{ height: '200px' }}>
    <Takeover
        title="Split Buttons"
        footer={<React.Fragment>
            <Button>Cancel</Button>
            <Button primary>Save</Button>
        </React.Fragment>}
        footerAlign="space-between"
        theme="light"
    >
    </Takeover>
</div>

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';