Skip to content

dpconfig widgets

Bee edited this page Aug 18, 2025 · 2 revisions

Widgets define the graphical user interface for the config.

Each widget is an object and requires the type key describing the widget type.

Info widgets

Type: title or heading

A title or heading. Titles and headings have different sizes! Title is the larger one, a heading is smaller.

  • text string: The heading text. Required.

Type: text

Shows text. The text may be formatted in HTML, but not all HTML tags are allowed.

  • text [required - string]

Type: image

Renders a cool picture.

  • file [required - string] - path to the image file (in the archive!)
    • for example assets/my_pack_logo.png or pack.png
  • width - scale the image to this width (integer or string)
  • height - scale the image to this height (integer or string)

Input widgets

These widgets have inputs.

They all share the following options:

  • text [required] - the description (string)
  • method or methods - the method to insert input into (string or array of strings)
  • slots - the slots to write input to (either single slot's name as string or list/array of slot names, without prefix)

Type: number

The quintessential config option. Allows the user to modify a number. In the interface this is done using a spinbox.

  • value [required] - describes the value to accept as input {object}
    • type [required] - either "int", "percent" or "float". "percent" converts into a float on export, but is otherwise treated as an integer
    • range [required] - a list describing the range of acceptable values, the minimum and maximum, in that order, both inclusive
    • default [required] - the default value, default is the range minimum (integer/float)
    • step - the step interval, the default depends on value type (integer/float)
    • suffix - the suffix to add at the end of the number, purely visual; percentages use %, but this can be overwritten (string)
    • decimals - float only, the number of decimals to show (integer)

Type: slider

A slider that allows the user to select a number from a range. Outputs either an integer or a float, depending on value type.

  • value [required] - describes the value to accept as input {object}
    • type [required] - either "int" or "percent". "percent" converts into a float on export, but is otherwise treated as an integer
    • range [required] - a list describing the range of acceptable values, the minimum and maximum, in that order, both inclusive
    • default [required] - the default value, default is the range minimum (integer)
    • step - the step interval, default is 1 (integer)

Type: switch

A button that the user can enable or disable. Only outputs true or false, but only if the user changed the state. If the state was unchanged, or changed back to default, there is no output from this widget.

  • value [required] - describes the value to accept as input {object}
    • default [required] - the default state, either true or false
Clone this wiki locally