Skip to content

Instantly share code, notes, and snippets.

@danbahrami
Last active March 18, 2019 16:13
Show Gist options
  • Save danbahrami/7ab4530500e416af691024a4706e6dfa to your computer and use it in GitHub Desktop.
Save danbahrami/7ab4530500e416af691024a4706e6dfa to your computer and use it in GitHub Desktop.

When should a component go into the UI Kit?

If every component we built were to go straight into the UI Kit it would become unmanagable. We should be selective about what components deserve their place in the UI Kit. If you're considering adding a component, here are some questions you should ask.

1) Is my component found in multiple parts of the app?

If you've only used a component once it's difficult to foresee how re-usable it is. If this is the case it probably doesn't belong in the UI Kit yet.

2) How feature specific is my component?

Even if you have used a component multiple times in the app, it's possible that your component is so specific to the contexts it's been used that it would be hard for other developers to re-use it. A <Button /> can be used anywhere but an <AddWidgetButtonWithSparkleEffects /> has limited re-use.

3) Does my component contain any business logic?

This is a UI Kit. We don't care about state management here. If your component has any side effects or reliance on the business logic of our app it should stay where it is.

4) Does my component render any child components that aren't in the UI Kit?

Our main app has the UI Kit as a dependency, we do not want it to be a two-way dependency. If your component renders other components that haven't yet been moved to the UI Kit consider either moving those components in first or changing the component so it doesn't rely on them.


If your component is found in multiple parts of the app, is generic enough to be reused in multiple features/contexts, doesn't contain any business logic and doesn't render any components that aren't in the UI Kit then it's time to start planning how to add it.

Here's our guide to migrating an existing component to the UI Kit

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment