Skip to content

React component for mentioning using Zurb's Tribute library

License

Notifications You must be signed in to change notification settings

BolsteDev/react-tribute

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

React Tribute


A React Component that uses zurb/tribute, by Bolste.

Installing

You can install React Tribute using npm: npm install react-tribute; however, we prefer yarn: yarn install --save react-tribute.

Import into your ES6 code.

import Tribute from 'react-tribute';

Usage

You can simply wrap any textarea, input, or contenteditable element with Tribute:

<Tribute
  options={{
    values: [{ key: "Test McTesterson", value: "test"}  
  }}
>
  <textarea></textarea>
</Tribute>

The Tribute component will bind tributejs to the textarea that you pass it as children.

The Tribute component takes all options that zurb/tribute expects. The only exception is that you can provide a function to the menuContainer option that returns a DOM node.

For more advanced usage, such as menuContainer, customRefs, and the onChange callback, see the Github Pages.

Testing

You can run the Mocha tests using:

npm run test
npm run test -- -w # if you want to watch for changes and rerun tests

Build for Production

Build the dist and example using:

npm run run

About

React component for mentioning using Zurb's Tribute library

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published