Pup / React
React components powered by Pup.
- Install with npm:
npm install underdog-pup-react --save
- Import components.
import Button from 'underdog-pup-react';// Do things with Button
- Import styles for components.
Adding a new component
Follow these steps to add a new component:
- Create a new directory that matches the name of your new component to
For example, if your component is named
CandidatePreview, create a new directory at
- Add the code for your component.
Create a file named
index.js in your newly created directory, and add the code for your component to it. The file should be located at
- Add some documentation for your component.
Create a new file named
docs.js in the directory for your component. This file must export a React Component, and it should contain a demonstration of how the component works.
Be sure to create a set of thorough test cases to make sure the component looks and works as expected in a variety situations.
You should also set the
displayName property on your component to the name of the component the documentation is for. This value will used to label the component in the styleguide.
- Add unit tests for your component in the
Add tests to ensure the component behaves as expected.
- Add your component as an export in
This will make your component accessible to projects that depend on this library.
- Add your component to the listing of components in
This will make the component visible in the styleguide.