1.0.7 • Published 4 years ago

yed-tag-input v1.0.7

Weekly downloads
12
License
MIT
Repository
github
Last release
4 years ago

yed-tag-input

yed-tag-input

NPM JavaScript Style Guide

Install

npm install --save yed-tag-input

Demo

Demo.

Usage

import React, { useState } from 'react'

import YedTagInput from 'yed-tag-input'
import 'yed-tag-input/dist/index.css'

const Example=()=>{
  const initTags: Array<any> = []
  const [tags, setTags] = useState(initTags)
  const setTag = (tag: any) => {
    setTags([...tags, tag])
  }
  const deleteTag = (item: any) => {
    const deletedTags = JSON.parse(JSON.stringify(tags))
    deletedTags.splice(item.index, 1)
    setTags(deletedTags)
  }
  return (
      <YedTagInput tags={tags} tagInputErrorControl={true}  tagInpuTitle={'Kişileri Ekle'} onChange={setTag}  removeTag={(item) => {deleteTag(item)}}  />
   )

}
export default Example

Props

Props NameDescriptionDefault ValueRequired
tagsThe tag array that the input element containsnulltrue
tagInputErrorControlSpecifies whether the tag input element will control elements of the same valuefalsefalse
tagInpuTitleThe title value of the tag input elementnullfalse
tagColorBackground color of tagscolorBluefalse
textColorText color of tags#ffffalse
tagInputTitleColorThe title color of the tag input element#9799a7false
errorTextThe value that tag input element will take in case of errorEtiket daha önce kullanıldı.false
tagInputErrorColorDetermines the color of the text shown in the error state of the tag input element#ff4d4ffalse

Functions

Function NameDescriptionRequiredReturn Value
onChangeWorks when a new tag is addedtruetag(string)
removeTagWorks when a tag is deleted from the listtrueThe value to be deleted and the sequence number of the value to be deleted ({index, item})

License

MIT © yasiinn

1.0.7

4 years ago

1.0.6

4 years ago

1.0.5

4 years ago

1.0.4

4 years ago

1.0.3

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago