An overlay mask for a large content area such as a page.

<Mask>
    <Page
        header={
            <Stack alignItems="center" spacing="0">
                <Stack.Item fill>
                    <Headline size="large">Page Title</Headline>
                    <BodyText subdued>A short page description.</BodyText>
                </Stack.Item>
                <Button primary>Action</Button>
            </Stack>
        }
    >
        <Card>
            <Headline className="m-b-1">Card Title</Headline>
            <BodyText className="m-b-2">Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</BodyText>
            <Button primary>Approve</Button>
        </Card>
        <Card>
            <Headline className="m-b-1">Card Title</Headline>
            <BodyText className="m-b-2">Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</BodyText>
            <Button primary>Approve</Button>
        </Card>
    </Page>
</Mask>

Element Mask

Add a mask over a specific element such as a <Card>. Use a prop to apply border-radius if the mask added to a <Card /> or similar component that has a border-radius applied.

<Page
    header={
        <Stack alignItems="center" spacing="0">
            <Stack.Item fill>
                <Headline size="large">Page Title</Headline>
                <BodyText subdued>A short page description.</BodyText>
            </Stack.Item>
            <Button primary>Action</Button>
        </Stack>
    }
>
    <div className="m-b-2">
        Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
    </div>
    <Mask borderRadius={1} >
        <Card>
            <Headline className="m-b-1">Card Title</Headline>
            <BodyText className="m-b-2">Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</BodyText>
            <Button primary>Approve</Button>
        </Card>
    </Mask>
</Page>

Loading Content Container

The default loading indicator for a Mask is <Spinner />, but you can add your own content for a dialog-like box above the Mask.

<Mask
    content={
        <div className="p-1" style={{ textAlign: 'center' }}>
            <div className="m-b-2">
                <img src={'/images/pricebook-illustration.svg'} />
            </div>
            <Headline size="small" className="m-b-1">Adding to Pricebook...</Headline>
            <BodyText size="small">You can navigate away from this page and this process will continue.</BodyText>
            <ProgressBar indeterminate position='bottom' small />
        </div>
    }
>
    <Page
        header={
            <Stack alignItems="center" spacing="0">
                <Stack.Item fill>
                    <Headline size="large">Page Title</Headline>
                    <BodyText subdued>A short page description.</BodyText>
                </Stack.Item>
                <Button primary>Action</Button>
            </Stack>
        }
    >
        <div className="m-b-2">
            Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
        </div>
        <div>
            <Card className="m-b-2">
                <Headline className="m-b-1">Card Title</Headline>
                <BodyText className="m-b-2">Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</BodyText>
                <Button primary>Approve</Button>
            </Card>
            <Card className="m-b-2">
                <Headline className="m-b-1">Card Title</Headline>
                <BodyText className="m-b-2">Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</BodyText>
                <Button primary>Approve</Button>
            </Card>
        </div>
    </Page>
</Mask>

Related Components


Importing

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