Code Monkey home page Code Monkey logo

ionic2-tags-input's Introduction

Ionic2 Tags Input

Ionic 2 Module which allows to write the content in popular tags form.

Features

  • Custom labels and placeholders
  • Maximum length of word restriction
  • Maximum amount of items restriction
  • Prevent duplicates restriction
  • Callback fn after added or removed tag

Gif

Installation

1. Install the NPM Package

npm install --save ionic2-tags-input

2. Import TagsInputModule module into your app's module.

import { TagsInputModule } from 'ionic2-tags-input';

// import the module
@NgModule({
  ...
  imports: [
    TagsInputModule
  ]
})

Usage

Bind component to formControl or ngModel

<tags-input formControlName="animals"></tags-input>

Form structure

  public animals:FormGroup =  this.formBuilder.group({
    animals: [
        [
            {
                'name': 'Gazelle'
            },
            {
                'name': 'Cat'
            }
        ]
    ],
  });

@Inputs / Attributes

Name Type Description Default Value
maxTags number Number of tags allowed. If maximum value is achieved, add button becomes disabled N/A
maxWordLength number Maximum length of the word/sentence N/A
allowDuplicates boolean Allow duplicates false
buttonLabel string Add button label Add
alertTitleLabel string The title of alert Add item
alertInputPlaceholder string Placeholder of the input inside the alert modal Type text
alertButtonLabel string Label of the alert button OK
wordLengthRestrictionMsg string Text displayed if word is too long Error: This word is too long
duplicatesRestrictionMsg string Text displayed if user is trying to make a duplicate Error: Duplicates are not allowed

@Outputs

Attribute Name Type Description
onTagAdded fn Callback fn after added tag
onTagRemoved fn Callback fn after removed tag

ionic2-tags-input's People

Watchers

James Cloos avatar Shannon Babincsak 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.