A container for displaying a page.

A page consists of the following components:

  • Page
    • The container for the entire page.
  • PageBreadcrumbs
    • The breadcrumbs to be displayed above the page header. It should contain a Breadcrumbs component.
  • PageHeader
    • The container, renders a header tag.
  • PageHeaderIconTile
    • An icon tile displayed to the left of the title.
  • PageHeaderLabel
    • A status label displayed next to the title.
  • PageHeaderTitle
    • The title of the page header.
  • PageHeaderActions
    • The actions to be displayed on the right side of the page header. It should contain Button components.
  • PageHeaderDescription
    • The description of the page header.
  • PageHeaderTabs
    • The tabs to be displayed below the page header. It should contain a Tabs component.
  • PageBody
    • The container for the body of the page.

You can mix and match these components to create a simple or complex page header. At minimum you should have a PageHeader, PageHeaderTitle, and PageBody.

Importing

The components can be imported via:

import {
	Page,
	PageBreadcrumbs,
	PageHeader,
	PageHeaderIconTile,
	PageHeaderLabel,
	PageHeaderTitle,
	PageHeaderActions,
	PageHeaderDescription,
	PageHeaderTabs,
	PageBody,
} from '@customerio/pluma-components/react';

Example

<Page>
	<PageBreadcrumbs>
		<Breadcrumbs
			breadcrumbs={[
				{ text: 'Page 1', href: '#' },
				{ text: 'Page 2', href: '#' },
				{ text: 'Page 3', href: '#' },
				{ text: 'Page 4', href: '#' },
			]}
		/>
	</PageBreadcrumbs>
	<PageHeader>
		<PageHeaderIconTile name="document" />
		<PageHeaderLabel color="yellow" showStatusIndicator={true}>Draft</PageHeaderLabel>
		<PageHeaderTitle>Page Title</PageHeaderTitle>
		<PageHeaderActions>
			<Button variant="primary">Save</Button>
			<Button variant="secondary">Cancel</Button>
		</PageHeaderActions>
		<PageHeaderDescription>This is a description of the page.</PageHeaderDescription>
		<PageHeaderTabs>
			<TabNav
				tabs={[
					{ href: '#', text: 'Label' },
					{ href: '#', text: 'Label', isActive: true },
					{ href: '#', text: 'Label' },
					{ href: '#', text: 'Label' },
				]}
			/>
		</PageHeaderTabs>
	</PageHeader>
	<PageBody>
		<p>This is the body of the page.</p>
	</PageBody>
</Page>

PageHeaderIconTile

An icon tile displayed to the left of the title.

<PageHeaderIconTile name="document" />

PageHeaderLabel

A status label displayed next to the title.

<PageHeaderLabel color="yellow" showStatusIndicator={true}>Draft</PageHeaderLabel>

Full screen page

The Page component can be full screen by passing the isFullScreen prop.

<Page isFullScreen={true}>...</Page>

Page loading state

The Page component can be in a loading state by passing the isLoading prop.

<Page isLoading={true}>...</Page>

Page body loading state

When the page is full screen or has tabs, the page looks better with just the body in a loading state. This gives the user more of an anchor for the page. You can pass the isLoading prop to the PageBody component to achieve this.

<Page>
	<PageBody isLoading={true}>...</PageBody>
</Page>

API

PlumaPage extends Box

Whether the page should be full screen.

Whether the page is loading.

Default:1

The level of the heading (which maps to h1-h6 tags)

Default:'teal'

The color of the icon tile.

The name of the icon to render.

Default:true

Whether the label should render in a bold font weight

Default:grey

The visual style of the label. Note: When using status indicators, only red, yellow, green, blue, purple, and grey colors are supported.

Default:false

Whether the label should show a status indicator colored dot

Whether the page body is loading.