1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-11-30 16:18:07 +01:00
metamask-extension/ui/components/ui/card
George Marshall 8064ec34a1
Dark mode: colors obj UI, GREY, WHITE (#14118)
* Removing all COLORS.UI 1,2,3,4 from codebase

* Removing all unused versions of COLORS.GREY, COLORS.WHITE and some left over UI1,UI2,UI3,UI4 in docs
2022-03-22 12:44:01 -07:00
..
card.js Dark mode: colors obj UI, GREY, WHITE (#14118) 2022-03-22 12:44:01 -07:00
card.stories.js Dark mode: colors obj UI, GREY, WHITE (#14118) 2022-03-22 12:44:01 -07:00
card.test.js Updating Card ui component and adding story (#12666) 2021-11-15 13:13:54 -05:00
index.js Updating Card ui component and adding story (#12666) 2021-11-15 13:13:54 -05:00
README.mdx Updating colors in various components js and css (#13831) 2022-03-04 08:47:32 -08:00

import { Story, Canvas, ArgsTable } from '@storybook/addon-docs';

import Card from '.';

# Card

Cards are used to group related content or actions together.

<Canvas>
  <Story id="ui-components-ui-card-card-stories-js--default-story" />
</Canvas>

## Component API

The `Card` component extends the `Box` component. See the `Box` component for an extended list of props.

<ArgsTable of={Card} />

## Usage

The following describes the props and example usage for this component.

### Padding, Border and Background Color

The Card component has a set of default props that should meet most card use cases. There is a strong recommendation to not overwrite these to ensure our cards stay consistent across the app.

That being said all props can be overwritten if necessary.

```jsx
import { COLORS } from '../../../helpers/constants/design-system';

// To remove the border
<Card border={false} />
// All border related props of the Box component will work

// To remove or change padding
<Card padding={0} />
// All padding related props of the Box component will work

// To change the background color
<Card backgroundColor={COLORS.BACKGROUND_ALTERNATIVE} />
```