0.2.1 • Published 5 years ago

react-cool-card v0.2.1

Weekly downloads
7
License
MIT
Repository
github
Last release
5 years ago

react-cool-card

build status npm version

Simple card component for react.

Demo

Installation

Your can install the package from npm.

npm install react-cool-card

Usage

CoolCardImage

This is a simple CoolCardImage example.

import React from "react";
import { CoolCard, CoolCardImage, CoolCardText } from "react-cool-card";

export const Example = () => (
  <CoolCard>
    <CoolCardImage src="/sample.jpg" alt="sample" />
    <CoolCardText
      title="This is a title."
      description="This is a description."
    />
  </CoolCard>
);

CoolCardLink

This is a simple CoolCardLink example.

import React from "react";
import { CoolCardLink, CoolCardImage, CoolCardText } from "react-cool-card";

export const Example = () => (
  <CoolCardLink href="https://github.com/kqito/react-cool-card">
    <CoolCardImage src="/sample.jpg" alt="sample" />
    <CoolCardText
      title="This is a title."
      description="This is a description."
    />
  </CoolCard>
);

CoolCardEmoji

This is a simple CoolCardEmoji example.

import React from "react";
import { CoolCard, CoolCardEmoji, CoolCardText } from "react-cool-card";

export const Example = () => (
  <CoolCard>
    <CoolCardEmoji emoji="😄" />
    <CoolCardText
      title="This is a title."
      description="This is a description."
    />
  </CoolCard>
);

Props

CoolCard component

The same attributes as the div tag can be used. In addition, the following other attributes can be used.

PropertyTypeDefaultDescription
backgroundColorstring | undefined#ffffffSupport hex format.
colorstring | undefined#000000Support hex format.
animationDurationnumber | undefined500Animation duration on mouse hover.
fontSizestring | undefined1remThe base font size of the component.
widthstring | undefined400pxThe width of the component.
heightstring | undefined300pxThe height of the component.

CoolCardLink component

The same attributes as the a tag can be used. In addition, the following other attributes can be used.

PropertyTypeDefaultDescription
backgroundColorstring | undefined#ffffffSupport hex format.
colorstring | undefined#000000Support hex format.
animationDurationnumber | undefined500Animation duration on mouse hover.
fontSizestring | undefined1remThe base font size of the component.
widthstring | undefined400pxThe width of the component.
heightstring | undefined300pxThe height of the component.

CoolCardImage component

Same as img tag

CoolCardEmoji component

PropertyTypeDefaultDescription
emojistring-The displayed characters. NOTE: Only one character can be specified.
stylesReact.CSSProperties | undefined{}The CoolCardEmoji's style.
stylesOnHoverReact.CSSProperties | undefined{}The CoolCardEmoji's style on hover.

CoolCardText component

PropertyTypeDefaultDescription
titlestring | ReactElement-The title of the component.
descriptionstring | ReactElement-The description of the component.
subtitlestring | ReactElement | undefined""The subtitle of the component. This appears on mouse hover.

Also, You can check the works with storybook. Please follow the steps below. 1. git clone https://github.com/kqito/react-cool-card 1. cd react-cool-card 1. npm install 1. npm run storybook 1. Go to http://localhost:6006

License

MIT © kqito

0.2.1

5 years ago

0.2.0

5 years ago

0.1.4

5 years ago

0.1.3

5 years ago

0.1.2

5 years ago

0.1.1

5 years ago

0.1.0

6 years ago

0.0.4

6 years ago

0.0.3

6 years ago

0.0.2

6 years ago

0.0.1

6 years ago