Skip to main content
5.0.3Next5.1.05.0.35.0.25.0.15.0.04.0.94.0.84.0.73.2.03.1.03.0.13.0.02.1.12.0.101.0.0
Version: 5.0.3

React

This is a guide for using Triton Component Library in a React project.

Prerequisite

The Triton Component Library is distributed via JFrog. To install it the project must be configured to use KDI JFrog.

Installation

Install the package with the following npm command:

npm install @kognifai/triton-cl-react

or with yarn:

yarn add @kognifai/triton-cl-react

To get it to work you also have to make 2 changes to the repo:

Add a theme attribute to the main tag of the ´index´ file, located in your project.

<Tag data-theme="day"></Tag>

Add a global style to the react project. Import node_modules/@kognifai/triton-cl-core/dist/assets/css/design-system.css into your main function.

##Usage To use the components in your React app, you have to import the each component to use in the respective react function. This can be done like this:

import { AutoCompleteTriton } from '@kognifai/triton-cl-react';

export ListItems = list => {
...
}