React component library

Usage no npm install needed!

<script type="module">
  import detroitLabsKlondike from 'https://cdn.skypack.dev/@detroit-labs/klondike';



Detroit Labs npm version styled with prettier semantic-release CircleCI

Table of Contents generated with DocToc


Install Klondike and its required peer dependencies.

yarn add @detroit-labs/klondike glamor glamorous

Wrap your <App> component in the <Provider>, so that Klondike's component styles are applied in your application.

import { Provider } from '@detroit-labs/klondike'

  <App />



yarn install

This installs dependencies from NPM and should be run regularly when pulling down code from master or another branch.

yarn start

This starts the React Styleguidist server. Visit http://localhost:6060 to view the styleguide locally.

yarn commit

This commits code using the Commitizen command line tool. This is required for committing code, since the commit message format is specifically used for generating release notes and determining the next version to publish (thanks to semantic-release).

yarn build

This compiles the source code using Babel. The output directory is located at dist/ and contains the compiled JavaScript ready for consumption. The TypeScript definitions files (.d.ts) are also copied over during this process.

The .babelrc file defines a few presets and plugins that this codebase uses:

File Structure

All source code is located in the src/ directory. The file structure looks like:

├── Button
│   ├── Button.js
│   ├── Button.md
│   ├── index.d.ts
│   └── index.js
├── index.d.ts
├── index.js
├── theme.js
└── util.js


This is the entry point into Klondike, which exports the public API available to consumers.


This is the entry point into Klondike's TypeScript definitions.


This file defines the Glamorous theme used throughout the Klondike codebase. This allows components to use consistent colors, fonts, spacing, etc.

Component directory structure

Using Button as an example:

├── Button.js
├── Button.md
├── index.d.ts
└── index.js

The component file, which contains component styles, prop type documentation


The component documentation used by React Styleguidist to create styleguide documentation.


The entry point into the component module. This file defines the public API and which modules should be exported for use by the src/index.js main module. This will usually just reexport the component from Button.js.


The TypeScript definition for the component. This will be referenced by src/index.d.ts and exported for use by consumers.