Skip to main content

Chips

Description

<jp-chips> is a field component that makes typed input iterative.


Attributes

NameRequiredTypeDescription
idstringunique identifier
valuestringvalue of the input field
namestringname of the form control
placeholderstringtemporary text that appears in an input field before any input is entered
labelstringshows at the top of an input
labelType'outside' or 'inside'whether label is inside or outside of the field
minitemsnumberminimum number of items allowed
minitemsValidationMessagestringvalidation message for when component does not satisfy minitems
maxitemsnumbermaximum number of items allowed
maxitemsValidationMessagestringvalidation message for when component does not satisfy maxitems
patternRegExpeach chip has to satisfy pattern
patternValidationMessagestringvalidation message for when component does not satisfy pattern
requiredbooleandetermines if a chip is required
requiredValidationMessagestringvalidation message for when component does not satisfy required
uniquebooleandetermines if each chip has to be different
uniqueValidationMessagestringvalidation message for when component does not satisfy unique
validationMessages{[type]: string} where type is stringcompact way of writing validation messages in a single attribute


Slots

This component does not have any slots.



Methods

  • getValue
    • returns form field value
  • reportValidity
    • triggers reportValidity


Events

  • value
    • triggers when chips/input changes


Demo

Live Editor
// import '@jaspero/web-components/chips.wc.js';
// import '@jaspero/web-components/chips.css';

<jp-chips label="Chips" placeholder="Placeholder"></jp-chips>
Result
Loading...