Skip to content

Bar Element

The Bar element visualizes a value between 0.0 and 1.0 inside a UI script.

Use ui.addBar() to create the element and combine it with the shared General Elements Options.

js
ui.addBar(options);

Table of Contents

Bar Options

value

  • Type: number
  • Default: 0.0
  • Description: Fill level of the bar.

orientation

  • Type: string
  • Default: "horizontal"
  • Description: Fill direction.

Valid values

  • "horizontal": Fills left to right
  • "vertical": Fills bottom to top

barCornerRadius

  • Type: number
  • Default: 0
  • Description: Corner radius for the filled portion.

barColor

  • Type: string
  • Description: Fill color or gradient.

Example

javascript
import { widgetWindow } from "novadesk";

var exampleBarWindow = new widgetWindow({
    id: "exampleBar",
    width: 300,
    height: 40,
    backgroundColor: "rgba(255, 255, 255, 1)",
    script: "ui/script.ui.js"
});

Preview

Widget Preview