#892·stimulus

Feature Request: Support Arrays values in `DOMTokenList`-style

Author: myabcCreated Jul 4, 2026Updated Jul 4, 2026

Stimulus currently provides an Array-type for values. However it is encoded as JSON, which while necessary for complex objects, feels un-HTML-like for simple arrays of strings. At a practical level, it means extra care has to be made to escape values.

DOMTokenList is used in many places in Web APIs, such as classList and aria-described-by attributes. Ideally we would mimic that.

typescript
  static values = {
    permittedTypes: 'List' // or possibly DOMTokenList
  }

  connect() {
    this.permittedTypesValue.forEach((permittedType) => {
       console.log(permiitedType);
    });
  }