3.0.3 • Published 1 year ago

@wedgekit/card v3.0.3

Weekly downloads
-
License
MIT
Repository
-
Last release
1 year ago

Card

Purpose

A card is a way to visually group a collection of components on a page.

A card will wrap it's children in a relatively postioned white(N050) div with a box-shadow.

Focusing in or hovering over the contents of the card will cause the box-shadow to darken to draw the user's attention into the card.

Usage

import styled from 'styled-components';

import { IconButton } from '@wedgekit/button';
import Card from '@wedgekit/card';
import { Text } from '@wedgekit/core';

const InstallerWrapper = styled.div`
  display: flexbox;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  padding: 20px;
  margin: 8px 32px;
`;

const Example = () => {
  const addInstaller = (e) => {
    console.log(e.target.getAttribute('aria-label'));
  };

  return (
    <Card>
      <InstallerWrapper>
        <Text>Installer Name</Text>
        <Text> 01/01/21 </Text>
        <Text> 01/02/21 </Text>
        <IconButton label="Add" icon="plus" domain="primary" onClick={addInstaller} />
      </InstallerWrapper>
    </Card>
  );
};

render(<Example />);

Props

children

Type: JSX.Element

Required: ✅

Children is the content of the Card.

className

Type: string

required: ❌

This is exposed but is only here so that styled-components will be able to style components correctly. Please do not use this unless you really know what you are doing.

ref

Type: RefObject<HTMLDivElement>

Required: ❌

An external ref can be passed in to provide acces to the underlying DOM elements.

3.0.3

1 year ago

3.0.2

1 year ago

3.0.1

2 years ago

3.0.0-tc.0

2 years ago

3.0.3-tc.0

1 year ago

3.0.0

2 years ago

2.0.2

2 years ago

2.0.1

2 years ago

2.0.0

3 years ago

1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago

0.0.0-tc.1

3 years ago

0.0.0-tc.2

3 years ago

0.0.0-tc.2npm

3 years ago

0.0.1-tc.1

3 years ago

0.0.0-tc.0

3 years ago