Git Product home page Git Product logo

ember-tribute's Introduction

Build Status

ember-tribute

A Ember Component wrapper for zurb/tribute

demo

Compatibility

  • Ember.js v2.18 or above
  • Ember CLI v2.13 or above

Installation

ember install ember-tribute

Usage

You can simply wrap any textarea, input, or contenteditable element with ui-tribute component:

{{#ui-tribute options=options}}
  <input type="text">
{{/ui-tribute}}

// where options will be the tribute collection object
options: {
    values: [
    { key: 'Jordan Humphreys', value: 'Jordan Humphreys', email: '[email protected]' },
    { key: 'Sir Walter Riley', value: 'Sir Walter Riley', email: '[email protected]' }
  ]
},

The ui-tribute component will bind tributejs to the textarea that you pass it as children. The ui-tribute component takes all options that zurb/tribute expects.

Arguments and Events

You can pass a action tributeReplaced to like {{#ui-tribute tributeReplaced=(action 'someaction')}} to the component which acts as the callback for tribute-replaced event emitted by Tribute.

Similarly you can pass a action tributeNoMatch to like {{#ui-tribute tributeNoMatch=(action 'someaction')}} to the component which acts as the callback for tributeNoMatch event emitted by Tribute.

If you wish to get the Tribute instance itself, pass an action registerTributeInstance to the component like {{#ui-tribute registerTributeInstance=(action 'someaction')}} and the action will be called with the Tribute instance object as its parameter.

For nested components in yield use target to pass the query selector string for the elment for Tribute to be attached to.

License

This project is licensed under the MIT License.

ember-tribute's People

Contributors

dependabot-support avatar dependabot[bot] avatar ember-tomster avatar mrrobz avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.