@opencollective/frontend-components

0.5.0 • Public • Published

Open Collective Frontend components

This project is an extract of the Open Collective Frontend components. It is meant to be used as a library of React components for Open Collective projects such as our Frontend Template.

How to add this to your project

Requirements: You React to be set up on your project.

  1. Add the dependency and its peer dependencies to your project:
npm install --save-exact @opencollective/frontend-components
  1. Plug the Open Collective theme in your project (usually in _app.js):
import { ThemeProvider } from 'styled-components';
import theme from '@opencollective/frontend-component/lib/theme';

const App = () => (
  <ThemeProvider theme={theme}>
    <Component />
  </ThemeProvider>
);
  1. Use components from the library
import StyledButton from '@opencollective/frontend-components/StyledButton';

const MyComponent = () => <StyledButton buttonStyle="primary">Hello<StyledButton>;

ESM caveat

This library is distributed as ESM. If you are using Next.js, you'll need to feed this package into https://www.npmjs.com/package/next-transpile-modules to make it work.

Readme

Keywords

none

Package Sidebar

Install

npm i @opencollective/frontend-components

Weekly Downloads

5

Version

0.5.0

License

none

Unpacked Size

683 kB

Total Files

129

Last publish

Collaborators

  • kewitz
  • znarf
  • betree