@@ -863,6 +863,183 @@ import type {
863863
864864---
865865
866+ ## TagsField (Quasar)
867+
868+ A chip-based tags input for arrays of free-form strings. Ideal for email addresses, keywords, labels, or any list where users type and add values.
869+
870+ ### Handles
871+
872+ - ` type: 'array' ` with ` 'x-render': 'tags' `
873+
874+ ### Example Schema
875+
876+ ** Email recipients:**
877+ ``` typescript
878+ {
879+ type : ' array' ,
880+ title : ' Recipients' ,
881+ description : ' Email addresses to send to' ,
882+ ' x-render' : ' tags' ,
883+ items : {
884+ type : ' string' ,
885+ format : ' email'
886+ },
887+ minItems : 1
888+ }
889+ ```
890+
891+ ** Keywords:**
892+ ``` typescript
893+ {
894+ type : ' array' ,
895+ title : ' Keywords' ,
896+ ' x-render' : ' tags' ,
897+ ' x-placeholder' : ' Add keywords...' ,
898+ items : {
899+ type : ' string' ,
900+ minLength : 2
901+ }
902+ }
903+ ```
904+
905+ ### Features
906+
907+ - ** Type and press Enter** to add a new tag
908+ - ** Paste multiple values** - comma/semicolon/newline separated values are parsed automatically
909+ - ** Click X to remove** tags
910+ - ** Per-item validation** - invalid items show as red chips with error icon
911+ - ** Duplicate prevention** - same value won't be added twice
912+ - ** Smart placeholder** - auto-detects email format for contextual placeholder
913+ - ** Full QChip customization** - color, icon, outline, size, etc.
914+
915+ ### Per-Item Validation
916+
917+ The TagsField validates each item against the ` items ` schema:
918+
919+ - ` format: 'email' ` - validates email format
920+ - ` format: 'url' ` - validates URL format
921+ - ` minLength ` / ` maxLength ` - validates string length
922+ - ` pattern ` - validates against regex pattern
923+ - ` enum ` - validates against allowed values
924+
925+ Invalid items are displayed as ** red chips with an error icon** and trigger validation errors that block form submission.
926+
927+ ### Schema Extensions
928+
929+ | Extension | Type | Default | Description |
930+ | -----------| ------| ---------| -------------|
931+ | ` x-render ` | ` 'tags' ` | - | Required. Enables tags input mode |
932+ | ` x-placeholder ` | ` string ` | Auto-detected | Custom placeholder text |
933+
934+ ### QuickForms Features (` x-quickforms-quasar ` )
935+
936+ ** Chip customization:**
937+ ``` typescript
938+ {
939+ type : ' array' ,
940+ title : ' Tags' ,
941+ ' x-render' : ' tags' ,
942+ items : { type : ' string' },
943+ ' x-quickforms-quasar' : {
944+ chip: {
945+ color: ' secondary' , // Quasar color
946+ textColor: ' white' , // Text color
947+ icon: ' label' , // Icon inside chip
948+ outline: true , // Outline style
949+ dense: true , // Dense mode
950+ square: true // Square corners
951+ }
952+ }
953+ }
954+ ```
955+
956+ ** Custom separator pattern:**
957+ ``` typescript
958+ {
959+ type : ' array' ,
960+ title : ' Emails' ,
961+ ' x-render' : ' tags' ,
962+ items : { type : ' string' , format : ' email' },
963+ ' x-quickforms-quasar' : {
964+ separator: / [,;\n ] + / // Only split on comma, semicolon, newline (not spaces)
965+ }
966+ }
967+ ```
968+
969+ ** Default chip props:**
970+ ``` typescript
971+ // Default styling applied to all chips
972+ {
973+ removable : true ,
974+ dense : true ,
975+ color : ' primary' ,
976+ textColor : ' white'
977+ }
978+ ```
979+
980+ ### Global Defaults
981+
982+ ``` typescript
983+ const options: QuasarFormOptions = {
984+ registry: createQuasarRegistry (),
985+ quickformsDefaults: {
986+ tags: {
987+ chip: {
988+ color: ' accent' ,
989+ textColor: ' white' ,
990+ dense: true
991+ },
992+ separator: / [,;\s ] + / // Default: comma, semicolon, or whitespace
993+ }
994+ }
995+ }
996+ ```
997+
998+ ### Native Quasar Props
999+
1000+ The underlying QSelect accepts native props via ` x-quasar-props ` :
1001+
1002+ ``` typescript
1003+ {
1004+ type : ' array' ,
1005+ title : ' Tags' ,
1006+ ' x-render' : ' tags' ,
1007+ items : { type : ' string' },
1008+ ' x-quasar-props' : {
1009+ outlined: true ,
1010+ filled: false ,
1011+ color: ' secondary' ,
1012+ dense: true
1013+ }
1014+ }
1015+ ```
1016+
1017+ ### Comparison: TagsField vs ArrayField vs MultiEnumField
1018+
1019+ | Feature | TagsField | ArrayField | MultiEnumField |
1020+ | ---------| -----------| ------------| ----------------|
1021+ | Use case | Free-form input | Structured items | Fixed options |
1022+ | Input method | Type + Enter | Add button | Select from list |
1023+ | Display | Chips inline | Expandable items | Chips |
1024+ | Validation | Per-item | Per-item | Enum only |
1025+ | Schema | ` x-render: 'tags' ` | ` type: 'array' ` | ` items.enum ` |
1026+
1027+ ** When to use TagsField:**
1028+ - Email addresses (to, cc, bcc)
1029+ - Keywords or labels
1030+ - Any free-form list where users type values
1031+
1032+ ** When to use ArrayField:**
1033+ - Complex item objects
1034+ - Items with multiple fields
1035+ - Items that need individual editing
1036+
1037+ ** When to use MultiEnumField:**
1038+ - Fixed set of allowed values
1039+ - Selecting from predefined options
1040+
1041+ ---
1042+
8661043## ArrayField
8671044
8681045Renders dynamic array fields with add/remove buttons.
0 commit comments