forked from patternfly/patternfly-react
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSkeletonCard.tsx
More file actions
39 lines (38 loc) · 1.44 KB
/
SkeletonCard.tsx
File metadata and controls
39 lines (38 loc) · 1.44 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
import { Gallery, Flex, PageSection, Content, Card, CardBody, Skeleton } from '@patternfly/react-core';
import { DashboardWrapper } from '@patternfly/react-core/src/demos/DashboardWrapper';
export const SkeletonCard: React.FunctionComponent = () => {
const card = (index: number) => (
<Card key={index} isCompact>
<CardBody>
<Flex direction={{ default: 'column' }} spacer={{ default: 'spacerMd' }}>
<Skeleton screenreaderText="Loading content" />
<Skeleton width="66%" />
<Skeleton width="25%" />
<Skeleton width="50%" />
</Flex>
</CardBody>
<CardBody>
<Skeleton shape="square" width="75%" screenreaderText="Loading medium square contents" />
</CardBody>
<CardBody>
<Flex direction={{ default: 'column' }} spacer={{ default: 'spacerMd' }}>
<Skeleton screenreaderText="Loading content" />
<Skeleton width="25%" />
<Skeleton width="75%" />
<Skeleton width="50%" />
</Flex>
</CardBody>
</Card>
);
return (
<DashboardWrapper isBreadcrumbWidthLimited>
<PageSection isWidthLimited>
<Content component="h1">Main title</Content>
<Content component="p">This is a full page demo.</Content>
</PageSection>
<PageSection>
<Gallery hasGutter>{Array.from({ length: 7 }).map((_value, index) => card(index))}</Gallery>
</PageSection>
</DashboardWrapper>
);
};