3.2.4 • Published 11 months ago
@leafygreen-ui/expandable-card v3.2.4
Expandable Card
View on MongoDB.design
Installation
Yarn
yarn add @leafygreen-ui/expandable-card
NPM
npm install @leafygreen-ui/expandable-card
Example
import ExpandableCard from '@leafygreen-ui/expandable-card';
<ExpandableCard
title="Lorem Ipsum"
description="Donec id elit non mi porta gravida at eget metus"
flagText="optional"
darkMode={false}
>
Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut
fermentum massa justo sit amet risus.
</ExpandableCard>;
Output HTML
<div id="expandable-card-1">
<div
role="button"
aria-expanded="true"
aria-controls="expandable-card-content-1"
id="expandable-card-summary-1"
tabindex="0"
>
<span>
<h3>Lorem Ipsum</h3>
<span>optional</span>
</span>
<div>Donec id elit non mi porta gravida at eget metus.</div>
<svg
width="16"
height="16"
fill="none"
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 16 16"
role="img"
aria-label="Chevron Up Icon"
>
...
</svg>
</div>
<div
role="region"
id="expandable-card-content-1"
aria-labelledby="expandable-card-summary-1"
>
<div>
Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh,
ut fermentum massa justo sit amet risus.
</div>
</div>
</div>
Properties
Prop | Type | Description | Default |
---|---|---|---|
title | React.ReactNode | The title of the card (Required) | |
description | string | Description text below the title | |
flagText | string | Text in parentheses immediately following the title. Typically 'optional' or 'required' | |
darkMode | boolean | Toggles dark mode | false |
defaultOpen | boolean | Defines the default state of the card | false |
isOpen | boolean | Forces the card state | undefined |
onClick | (event: React.SyntheticEvent) => void | Callback fired when a user clicks the card header | |
id | string | Unique id for the card | |
className | string | Styling prop | |
contentClassName | string | Styling prop for children |
3.2.4
11 months ago
3.2.3
1 year ago
3.2.2
1 year ago
3.2.1
1 year ago
3.2.0
1 year ago
3.1.0
1 year ago
3.0.24
1 year ago
3.0.23
1 year ago
4.0.0-alpha.1
2 years ago
4.0.0-alpha.0
2 years ago
3.0.13
2 years ago
3.0.16
2 years ago
3.0.17
2 years ago
3.0.14
2 years ago
3.0.15
2 years ago
3.0.21
2 years ago
3.0.22
2 years ago
3.0.20
2 years ago
3.0.18
2 years ago
3.0.19
2 years ago
3.0.9
2 years ago
3.0.12
2 years ago
3.0.10
2 years ago
3.0.11
2 years ago
3.0.11-next.7
2 years ago
3.0.11-next.5
2 years ago
3.0.11-next.6
2 years ago
3.0.11-next.3
2 years ago
3.0.11-next.4
2 years ago
3.0.11-next.1
2 years ago
3.0.11-next.2
2 years ago
3.0.11-next.0
2 years ago
3.0.8
2 years ago
3.0.7
2 years ago
3.0.6
2 years ago
3.0.4
2 years ago
3.0.3
2 years ago
3.0.2
3 years ago
3.0.1
3 years ago
3.0.5
2 years ago
3.0.0
3 years ago
1.1.1
3 years ago
1.1.0
3 years ago
1.1.0-test.1
3 years ago
1.1.2
3 years ago
2.0.1
3 years ago
2.0.0
3 years ago
1.0.0
3 years ago
1.0.1-test.0
3 years ago
1.0.1-next.3
3 years ago
1.0.1-next.2
3 years ago
1.0.1-next.1
3 years ago
1.0.1-next.0
3 years ago
0.9.6
3 years ago
0.9.4
3 years ago
0.9.5
3 years ago
0.9.3
3 years ago
0.9.2
3 years ago
0.9.1
3 years ago
0.9.0
4 years ago