Skip to content


Autocomplete can be customized for UnoCSS's intelligent suggestions in playground and the VS Code extension.

autocomplete: {
  templates: [
    // theme inferring
    // short hands
    // logic OR groups
    // constants
  shorthands: {
    // equal to `opacity: "(0|10|20|30|40|50|60|70|90|100)"`
    'opacity': Array.from({ length: 11 }, (_, i) => i * 10),
    'font-size': '(xs|sm|base|lg|xl|2xl|3xl|4xl|5xl|6xl|7xl|8xl|9xl)',
    // override built-in short hands
    'num': '(0|1|2|3|4|5|6|7|8|9)',
  extractors: [
      // ...extractors
  • templates uses a simple DSL to specify the autocomplete suggestions.

  • shorthands is a map of shorthand names to their templates. If it's a Array, it will be a logic OR group.

  • extractors to pickup possible classes and transform class-name style suggestions to the correct format. For example, you could check how we implement the attributify autocomplete extractor

  • For additional help, please refer to here.

Released under the MIT License.