Skip to main content
Version: 1.2.0

Getting Started

K2 Library is a dashboarding solution thats aims to allow users to create new dashboards within an hour or less. K2 is built on the principles of Reusability and Don't repeat yourself.

Our Manifesto

  1. Solve the problem once and reuse it everywhere.
  2. Reduce the time to start by leveraging sane defaults and minimal required inputs.
  3. Quality code, which is battle-tested, robust and predictable.
  4. Minimize maintenance effort required over time.

Installation

You can install the library using npm or yarn package manager using the following way:

  1. Create .npmrc in your project root and add following line in it:
@k2:registry= https://registry.npmjs.org
//registry.npmjs.org/:_authToken={key obtained from Emumba}
  1. Run yarn add command for the sub-package you need:
yarn add @k2/d3-viz
yarn add @k2/rv-viz
yarn add @k2/ui
yarn add @k2/utils
important

styled-components is peer dependency of K2. Please install it before using K2.

Usage

  1. Wrap your application/component with ThemeProvider.
import { Theme } from "@k2/utils";
function App() {
return <Theme.ThemeProvider>{...children}</Theme.ThemeProvider>;
}
ReactDOM.render(<App />, document.querySelector("#app"));
important

Wrapping of your application or component with ThemeProvider is required to utilize full features of K2 components.

  1. Use the K2 component.
import { Card } from "@k2/ui";
<Card title="card 1"></Card>;

Quick Start

Here's a quick example to get you started, it's all you need:

Live Editor

For more usage examples, kindly see StoryBook.

For more information please reach us at: k2@emumba.com