npm.io
4.0.4 • Published 1 year ago

@leafygreen-ui/expandable-card

Licence
Apache-2.0
Version
4.0.4
Deps
10
Size
109 kB
Vulns
0
Weekly
3.4K
Stars
271

Expandable Card

npm (scoped)

View on MongoDB.design

Installation

PNPM
pnpm add @leafygreen-ui/expandable-card
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>;

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