0.1.7 • Published 2 years ago

bettrdash-react-library v0.1.7

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

bettrdash-react-library

npm npm

A component that renders a users projects from the Bettrdash API.

Install

npm install --save bettrdash-react-library

or

yarn add bettrdash-react-library

Usage

Note: This component requires an API key to be passed in as a prop. If you do not have an API key, please visit BettrDash to get one.

BettrCard Component

import { BettrCard } from "bettrdash-react-library";

const Component = () => {
  return (
    <BettrCard
      apiKey="api-key"
      style={{
        width: "300px",
        titleFontSize: "20px",
        descriptionFontSize: "20px",
      }}
    />
  );
};

export default Component;

BettrCard Component Props

PropertyTypeRequiredDefaultDescription
apiKeyStringtrue-Api key from BettrDash dashboard
stylesObjectfalse-How to style the cards (refer to style props table for styling optoins)

Card Component

The card component can also be imported directly from the library.

import { Card } from "bettrdash-react-library";

const Component = () => {
  const project = {
    active: true,
    createdAt: "2022-06-09T02:09:52.026Z",
    description: "The dashboard for developers",
    github_url: "https://github.com/HelixHEX/bettrdash",
    image_url:
      "https://blog.addthiscdn.com/wp-content/uploads/2015/11/code.png",
    language: "Javascript",
    live_url: "https://bettrdash.eliaswambugu.com",
    name: "BettrDash",
    updatedAt: "2022-09-12T17:52:50.992Z",
  };
  return (
    <Card
      style={{
        width: "300px",
        titleFontSize: "20px",
        descriptionFontSize: "20px",
      }}
      project={project}
    />
  );
};

export default Component;

Card Component Props

PropertyTypeRequiredDefaultDescription
projectObjecttrue-Project object returned from the BettrDash API
stylesObjectfalse-How to style the cards (refer to style props table for styling optoins)

Style Props

PropertyTypeRequiredDefaultDescription
widthString or Numberfalse-Width of the card
heightString or Numberfalse-Height of the card
titleFontSizeString or Numberfalse-Font size for the title of the card
descriptionFontSizeString or Numberfalse-Font size for the description of the card
0.1.7

2 years ago

0.1.6

2 years ago

0.1.5

2 years ago

0.1.4

2 years ago

0.1.3

2 years ago

0.1.2

2 years ago

0.1.1

2 years ago

0.1.0

2 years ago