* annotation

JSON object to specify what to annotate inside content.

  • The key(s) will be used to search for placeholder
  • The configuration object (This page will focus on the available options in the configuration)
Quick Example:

Source Code:

Config Options

OptionTypeDefault ValueDescription
*typestring"string"type defines
- Styling of the annotation (powered by highlight.js)
- Input knob if knob is not defined
*knobstring"string"knob defines the input knob e.g. select, date and color
*valueanyundefinedThe (default) value passed to the annotation placeholder and the input knob
titlestringthe key of the annotationIf provided, the title will override the annotation key to be rendered in the popup
descriptionstringundefinedIf provided, the description will be rendered under the knob

type

type defines

  • Styling of the annotation. This part is powered by highlight.js' CSS themes
  • Input type if knob is not defined.
    • The following types include a default input knob
      • string
      • boolean
      • number
        • Optional: min and max
      • integer
        • Optional: min and max
    • The other types would use a string input knob, if knob is not defined

Available options are mirrored from highlight.js' CSS class, which could be found here (opens in a new tab).

Example:

Source Code:

Inside the popup, type is also shown here (e.g. type: 'boolean')

props annotation type

knob

knob defines custom input knob other than the basic string, boolean, number and integer types. Some knob needs to supplement other options e.g. for knob: 'select', you also need to pass the available options.

  • select
    • Required: options
  • date
    • Optional: min and max
  • time
  • datetime-local
    • Optional: min and max
  • range
    • Required: min and max
  • color
Example:

Source Code:

value

value is the (default) value to render in the placeholder. See examples in type or knob.

title

If provided, the title will override the annotation key to be rendered in the popup

Example:

Source Code:

description

If provided, the description will be rendered under the knob

Example:

Source Code: