@cloudflare/component-card

Cloudflare Card Component

Stats

StarsIssuesVersionUpdatedCreatedSize
@cloudflare/component-card
3.5.8015 days ago3 years agoMinified + gzip package size for @cloudflare/component-card in KB

Readme

@cloudflare/component-card

Cloudflare Card Component

Installation

Installation with yarn is recommended


$ yarn add @cloudflare/component-card

Usage

import React from 'react';
import {
  Card,
  CardBlock,
  CardContent,
  CardControl,
  CardDrawers,
  CardMessages,
  CardSection,
  CardTitle,
  CardFooter,
  CardToolbar,
  CardToolbarLink
} from '../../src';
import { Button } from '@cloudflare/component-button';

class CardComponent extends React.Component {
  constructor(props) {
    super(props);
    this.state = {
      activeDrawer: null
    };
  }

  render() {
    return (
      <Card>
        <CardSection>
          <CardContent>
            <CardTitle>Hello World</CardTitle>
            <p>Here is some content.</p>
            <CardMessages
              messages={[
                { type: 'info', content: 'Info Message' },
                { type: 'error', content: 'Error Message' }
              ]}
            />
            <CardFooter>This is a footer message</CardFooter>
          </CardContent>
          <CardControl>
            <CardBlock>This is a block</CardBlock>
            <CardBlock>
              <Button type="default" onClick={() => {}}>
                Example Control
              </Button>
            </CardBlock>
          </CardControl>
        </CardSection>
        <CardDrawers
          drawers={[
            {
              id: 'one',
              name: 'One',
              content: <p>One</p>
            },
            {
              id: 'two',
              name: 'Two',
              content: <p>Two</p>
            }
          ]}
        />
        <CardToolbar
          controls={[]}
          links={[
            <CardToolbarLink
              key="ToolBarLink"
              expandable={false}
              isActive={false}
              onClick={() =>
                window.open('https://en.wikipedia.org/wiki/Main_Page')
              }
            >
              Wikipedia
            </CardToolbarLink>
          ]}
        />
      </Card>
    );
  }
}

export default CardComponent;

If you find any bugs or have a feature request, please open an issue on github!

The npm package download data comes from npm's download counts api and package details come from npms.io.