3.2.2 • Published 24 days ago

@leafygreen-ui/expandable-card v3.2.2

Weekly downloads
-
License
Apache-2.0
Repository
github
Last release
24 days ago

Expandable Card

npm (scoped)

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

PropTypeDescriptionDefault
titleReact.ReactNodeThe title of the card (Required)
descriptionstringDescription text below the title
flagTextstringText in parentheses immediately following the title. Typically 'optional' or 'required'
darkModebooleanToggles dark modefalse
defaultOpenbooleanDefines the default state of the cardfalse
isOpenbooleanForces the card stateundefined
onClick(event: React.SyntheticEvent) => voidCallback fired when a user clicks the card header
idstringUnique id for the card
classNamestringStyling prop
contentClassNamestringStyling prop for children
3.2.2

24 days ago

3.2.1

1 month ago

3.2.0

2 months ago

3.1.0

2 months ago

3.0.24

2 months ago

3.0.23

3 months ago

4.0.0-alpha.1

10 months ago

4.0.0-alpha.0

10 months ago

3.0.13

10 months ago

3.0.16

9 months ago

3.0.17

9 months ago

3.0.14

10 months ago

3.0.15

9 months ago

3.0.21

8 months ago

3.0.22

7 months ago

3.0.20

8 months ago

3.0.18

9 months ago

3.0.19

9 months ago

3.0.9

12 months ago

3.0.12

11 months ago

3.0.10

12 months ago

3.0.11

11 months ago

3.0.11-next.7

12 months ago

3.0.11-next.5

12 months ago

3.0.11-next.6

12 months ago

3.0.11-next.3

12 months ago

3.0.11-next.4

12 months ago

3.0.11-next.1

12 months ago

3.0.11-next.2

12 months ago

3.0.11-next.0

12 months ago

3.0.8

1 year ago

3.0.7

1 year ago

3.0.6

1 year ago

3.0.4

1 year ago

3.0.3

1 year ago

3.0.2

1 year ago

3.0.1

1 year ago

3.0.5

1 year ago

3.0.0

1 year ago

1.1.1

2 years ago

1.1.0

2 years ago

1.1.0-test.1

2 years ago

1.1.2

2 years ago

2.0.1

2 years ago

2.0.0

2 years ago

1.0.0

2 years ago

1.0.1-test.0

2 years ago

1.0.1-next.3

2 years ago

1.0.1-next.2

2 years ago

1.0.1-next.1

2 years ago

1.0.1-next.0

2 years ago

0.9.6

2 years ago

0.9.4

2 years ago

0.9.5

2 years ago

0.9.3

2 years ago

0.9.2

2 years ago

0.9.1

2 years ago

0.9.0

2 years ago