0.1.7 • Published 2 years ago
bettrdash-react-library v0.1.7
bettrdash-react-library
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
Property | Type | Required | Default | Description |
---|---|---|---|---|
apiKey | String | true | - | Api key from BettrDash dashboard |
styles | Object | false | - | 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
Property | Type | Required | Default | Description |
---|---|---|---|---|
project | Object | true | - | Project object returned from the BettrDash API |
styles | Object | false | - | How to style the cards (refer to style props table for styling optoins) |
Style Props
Property | Type | Required | Default | Description |
---|---|---|---|---|
width | String or Number | false | - | Width of the card |
height | String or Number | false | - | Height of the card |
titleFontSize | String or Number | false | - | Font size for the title of the card |
descriptionFontSize | String or Number | false | - | Font size for the description of the card |