@s-ui/react-molecule-input-tags

2.28.0 • Public • Published

MoleculeInputTags

MoleculeInputTags is an AtomInput with the behavior of adding/removing AtomTag as a list

Installation

$ npm install @s-ui/react-molecule-input-tags --save

Usage

import MoleculeInputTags from '@s-ui/react-molecule-input-tags'
const closeIcon = () => <span>X</span>

Basic usage

<MoleculeInputTags tagsCloseIcon={closeIcon} />

Entering tags on Tab

<MoleculeInputTags tagsCloseIcon={closeIcon} onEnterKey="Tab" />

Initial list of tags

<MoleculeInputTags tagsCloseIcon={closeIcon} tags={['john','paul','george','ringo']} />

AtomInput props

All props of AtomInput can also be passed to MoleculeInputTags

<MoleculeInputTags tagsCloseIcon={closeIcon} errorState={true} />

Just unique values

You can set allowDuplicates to false to force unique values

<MoleculeInputTags allowDuplicates={false} />

Max tags

use maxTags prop to set a number of maximum tags that can be entered, after reaching that number the field gets disabled

<MoleculeInputTags maxTags={3} />

Find full description and more examples in the demo page.

Readme

Keywords

none

Package Sidebar

Install

npm i @s-ui/react-molecule-input-tags

Weekly Downloads

2,167

Version

2.28.0

License

MIT

Unpacked Size

10.5 kB

Total Files

7

Last publish

Collaborators

  • thomas.page.ext
  • victoria.pasichnyk.ext
  • daniel.perez.ext
  • albert.peiro
  • frandelacasa-adevinta
  • mariapaula.forero.ext
  • hpintos_adevinta
  • sziauberyte
  • victor.perez.adevinta
  • oscar-raig-adevinta
  • carlos.gonzalezl
  • carolina.mallo.ext
  • david.nieto
  • ferran.simon
  • xavi_conejo
  • sergi.quintela
  • jamile.radloff
  • xavi_ballestar
  • luz_adv
  • ignacio.rodriguez
  • carlosvillu-adevinta
  • diegomr
  • arturo.vicente
  • adria.velardos
  • emiliovz
  • dann41
  • ruben-martin
  • pol.valls
  • cristina.rodriguez.duque
  • sergio.escano
  • marc.benito
  • azahara
  • patricio.sartore
  • giovanny.sayas.ext
  • david.cuadrado.ext
  • alex.castells
  • beatrizip
  • pablo.rey-adevinta
  • sergiocollado
  • mango.sanchezredondo
  • cristhianb
  • alisa_bayanova
  • davidmartin2108
  • ferrangbtw
  • estefania_garcia
  • belen.santos
  • alfredo.arronte
  • joanleon-adv
  • giodelabarrera.adevinta
  • luis-garrido
  • aitor.rodriguez
  • jordi.munoz
  • oscar_ramirez
  • ignacio_navarro
  • a.ferrer
  • gfabregoadv
  • izeller
  • salvador.juan
  • oriol.egea
  • ivanmlaborda
  • alejandro.ferrante
  • pa.chruscinski.ext
  • isabelgomez87
  • jenifer.lopez
  • daniela.aguilera
  • pablogs
  • javier.miguel
  • oscar.gomez
  • marian.lucaci
  • alverd004
  • oriol.puig
  • nacho_torrella
  • xavi.murcia
  • chloe.leteinturier
  • javiauso
  • alfredo.zimperz
  • francisco.ruiz.lloret
  • fermin.adevinta
  • andresadv
  • schibstedspain