Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion packages/react-core/src/components/EmptyState/EmptyState.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,14 @@ import { css, getModifier } from '@patternfly/react-styles';
import styles from '@patternfly/react-styles/css/components/EmptyState/empty-state';

export enum EmptyStateVariant {
'xl' = 'xl',
large = 'large',
small = 'small',
full = 'full'
}

const maxWidthModifiers: { [variant in keyof typeof EmptyStateVariant]: string } = {
xl: 'xl',
large: 'lg',
small: 'sm',
full: ''
Expand All @@ -20,7 +22,7 @@ export interface EmptyStateProps extends React.HTMLProps<HTMLDivElement> {
/** Content rendered inside the EmptyState */
children: React.ReactNode;
/** Modifies EmptyState max-width */
variant?: 'small' | 'large' | 'full';
variant?: 'small' | 'large' | 'full' | 'xl';
}

export const EmptyState: React.FunctionComponent<EmptyStateProps> = ({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,42 @@ SimpleEmptyState = () => (
);
```

```js title=Extra-Large
import React from 'react';
import {
Title,
Button,
EmptyState,
EmptyStateVariant,
EmptyStateIcon,
EmptyStateBody,
EmptyStateSecondaryActions
} from '@patternfly/react-core';
import { CubesIcon } from '@patternfly/react-icons';

SimpleEmptyState = () => (
<EmptyState variant={EmptyStateVariant.xl}>
<EmptyStateIcon icon={CubesIcon} />
<Title headingLevel="h5" size="4xl">
Empty State
</Title>
<EmptyStateBody>
This represents an the empty state pattern in Patternfly 4. Hopefully it's simple enough to use but flexible
enough to meet a variety of needs.
</EmptyStateBody>
<Button variant="primary">Primary Action</Button>
<EmptyStateSecondaryActions>
<Button variant="link">Multiple</Button>
<Button variant="link">Action Buttons</Button>
<Button variant="link">Can</Button>
<Button variant="link">Go here</Button>
<Button variant="link">In the secondary</Button>
<Button variant="link">Action area</Button>
</EmptyStateSecondaryActions>
</EmptyState>
);
```

```js title=Spinner
import React from 'react';
import {
Expand Down