Skip to content

Commit

Permalink
Add description list basic demo (patternfly#10184)
Browse files Browse the repository at this point in the history
* add description list basic demo

* fix DashboardWrapper not found issue

* implement review comments

* add divider and size

* update content

* fixed layout issues
  • Loading branch information
ajaypratap003 authored and tlabaj committed Jun 14, 2024
1 parent adf25df commit 31d22c7
Show file tree
Hide file tree
Showing 2 changed files with 100 additions and 0 deletions.
14 changes: 14 additions & 0 deletions packages/react-core/src/demos/DescriptionList/DescriptionList.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
id: Description list
section: components
---

import CheckCircleIcon from '@patternfly/react-icons/dist/esm/icons/check-circle-icon';
import { DashboardWrapper } from '@patternfly/react-core/dist/js/demos/DashboardWrapper';

## Demos

### Basic

```js file='./examples/DescriptionListBasic.tsx' isFullscreen
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
import React from 'react';
import {
DescriptionList,
DescriptionListTerm,
DescriptionListGroup,
DescriptionListDescription,
PageSection,
PageSectionVariants,
Card,
CardBody,
CardHeader,
TextContent,
Text,
Title,
Divider,
Flex,
FlexItem
} from '@patternfly/react-core';
import CheckCircleIcon from '@patternfly/react-icons/dist/esm/icons/check-circle-icon';
import { DashboardWrapper } from '@patternfly/react-core/dist/js/demos/DashboardWrapper';

export const DescriptionListBasic: React.FunctionComponent = () => (
<DashboardWrapper>
<PageSection variant={PageSectionVariants.light}>
<TextContent>
<Title headingLevel="h1">Projects</Title>
<Text component="p">This is a full page demo</Text>
</TextContent>
</PageSection>
<PageSection>
<Card>
<CardHeader>
<Title headingLevel="h2" size="lg">
Details
</Title>
</CardHeader>
<Divider />
<CardBody>
<DescriptionList isAutoFit>
<DescriptionListGroup>
<DescriptionListTerm>Name</DescriptionListTerm>
<DescriptionListDescription>mary-test</DescriptionListDescription>
</DescriptionListGroup>
<DescriptionListGroup>
<DescriptionListTerm>Status</DescriptionListTerm>
<DescriptionListDescription>
<Flex>
<FlexItem spacer={{ lg: 'spacerSm' }}>
<CheckCircleIcon color="green" />
</FlexItem>
<FlexItem>Active</FlexItem>
</Flex>
</DescriptionListDescription>
</DescriptionListGroup>
<DescriptionListGroup>
<DescriptionListTerm>Default pull secret</DescriptionListTerm>
<DescriptionListDescription>Not configured</DescriptionListDescription>
</DescriptionListGroup>
<DescriptionListGroup>
<DescriptionListTerm>Tolerations</DescriptionListTerm>
<DescriptionListDescription>6 Tolerations</DescriptionListDescription>
</DescriptionListGroup>
<DescriptionListGroup>
<DescriptionListTerm>Network Policies</DescriptionListTerm>
<DescriptionListDescription>
<a href="#">Network Policies</a>
</DescriptionListDescription>
</DescriptionListGroup>
<DescriptionListGroup>
<DescriptionListTerm>Display name</DescriptionListTerm>
<DescriptionListDescription>mary</DescriptionListDescription>
</DescriptionListGroup>
<DescriptionListGroup>
<DescriptionListTerm>Requester</DescriptionListTerm>
<DescriptionListDescription>kube:admin</DescriptionListDescription>
</DescriptionListGroup>
<DescriptionListGroup>
<DescriptionListTerm>Created at:</DescriptionListTerm>
<DescriptionListDescription>3 minutes ago</DescriptionListDescription>
</DescriptionListGroup>
</DescriptionList>
</CardBody>
</Card>
</PageSection>
</DashboardWrapper>
);

0 comments on commit 31d22c7

Please sign in to comment.