nibi.ai.nlq

0.0.26 • Public • Published

nibi.ai.nlq

React implementation of the Nibi Autocomplete

Documentation

Install

Make sure you have Node.js 8+ and npm installed.

npm install nibi.ai.nlq@latest --save

Update module

npm update nibi.ai.nlq@latest --save

Example

import React, { Component } from 'react'

import NLQSearch from 'nibi.ai.nlq'
import 'nibi.ai.nlq/build/styles.css';

export default class App extends Component {
  constructor(props) {
    super(props);
    this.state = {
      nibiOptions : {
        placement : 'TOP'
      },
      nibiConfig : {
        datasource: 'DATASOURCE', //Required
        apiKey: 'API_KEY' //Required
      }
    }
  }
  onSearch = (message) => {
    console.log('onSearch message', message);
  }

  beforeAskQuestion = (npl) => {
    console.log('beforeAskQuestion npl', npl);
  }

  render() {
    return (
      <div>
        <NLQSearch config={this.state.nibiConfig} options={this.state.nibiOptions} onSearch={this.onSearch} onBeforeSearch={this.beforeAskQuestion} />
      </div>
    )
  }
}

License

Readme

Keywords

none

Package Sidebar

Install

npm i nibi.ai.nlq

Weekly Downloads

1

Version

0.0.26

License

none

Unpacked Size

1.38 MB

Total Files

6

Last publish

Collaborators

  • tomernibiai