Skip to content

Styleguide

Marco Segreto edited this page Feb 11, 2020 · 2 revisions

The styleguide helps document our front end components for developers and designers.

Setup

  1. Ensure all the correct components are installed, yarn install
  2. Ensure you have the shape branch checked out in the shared components: cd app/javascript/ui/shared && git checkout shape
  3. Run the styleguide server build process: yarn styleguide:build
  4. Run the separate styleguide webserver: yarn styleguide:server

Documenting components

Documenting PropTypes

For any component a developer can document the React PropTypes for that component in the component's file. To do this, above the line for a given PropType, you can write a JSDoc style comment to describe the prop:

/** The color of the background of the component */
colorScheme: PropTypes.string,
Clone this wiki locally