The Multimodal Component React library for the TROMPA project
This project is part of the TROMPA project.
Assuming you have a runnable React frontend application, the easiest way to start using the Multimodal Component, is to install it via NPM or Yarn.
If you're using NPM:
npm install --save trompa-multimodal-component
If you're using Yarn:
yarn add trompa-multimodal-component
This is a basic usage example. There will be more examples after more options have been added to the Multimodal Component.
import React, { Component } from 'react'
import { MultiModalComponent } from 'trompa-multimodal-component'
class Example extends Component {
render () {
return (
<MultiModalComponent
uri="http://localhost:4000"
onResultClick={node => console.log('User has clicked on:', node)}
/>
)
}
}
Prop | Type | Default value | Description | Required |
---|---|---|---|---|
uri | String | https://api-test.trompamusic.eu | The GraphQL uri used in the ApolloClient | No |
onResultClick | Function | function(result: Object) { } | Callback when the user clicks on a result. | No |
Apache-2.0 ©