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 => {
...
}