Skip to main content

Button

A button is a control that the user can click to perform an action.

Buttons can have icons, labels, and tooltips.

They can be styled with several attributes that change their color, shape, and look.

Attributes

Common

ID

Sets the object's ID.

The ID identifies the object and is used to reference it in UISet actions, allowing to change its attributes dynamically.

The ID is not unique, it can be shared among multiple objects to quickly change a common attribute.

IDs can't be changed with a UISet action, but they can have a Value Binding assigned to them. Value Bindings on IDs allow an object to be dinamically attached to a set of attribute values.

E.g. the following Value Binding switches the ID of the object between mybutton1 and mybutton2 based on the value of the UISet button.address:

Value binding: ="mybutton" + ui('button', 'address')

UISet: UISet('button', 'address', '1') switches the ID to mybutton1 UISet('button', 'address', '2') switches the ID to mybutton2

Position and Size

Position

Sets the object's position.

The default value is: x0y0.

Attribute Values
ValueDescriptionExample
x<left>y<top>Specify left/top coordinates in pixels.x10y20

Flex Grow

Specifies if the objects should grow to fill the available space.

The default value is: true.

Attribute Values
ValueDescription
trueDefault value. Objects expand to fill the available space.
falseObjects do not grow to fill the available space.

Flex Shrink

Specifies if the objects should shrink to fit the available space.

The default value is: true.

Attribute Values
ValueDescription
trueDefault value. Objects shrink to fit the available space.
falseObjects do not shrink to fit the available space.

Width

Sets the object's width in pixels.

Minimum value is 1.

Height

Sets the object's height in pixels.

Minimum value is 1.

Action

Action

Specifies the action performed when clicked/tapped.

Attribute Values
ValueDescription
noneNo action.
linkChanges page, shows a popup or opens a URL.
commandSends a command to the server, with the specified name and parameter.
datapointToggles a datapoint.
downloadFires a download file request that generates a specific command.

A server-side userCommand script must intercept the command.

If the content to be downloaded is an existing file, it should return a full pathname of the file to be downloaded, or a JSON object such as {"path":"pathname", "filename":"filename", "delete":true}, where path is the full pathname of the file to be downloaded and filename is the name of the file to be saved on the client. Delete is optional. When present and set to true, the file is deleted as soon as the download is initiated from the client.

If the returned pathname is a valid and accessible file under the HSYCO main directory, the download will be initiated.

It is also possible to generate the binary content to be downloaded directly from the userCommand script. In this case userCommand should return a JSON object like {"data":"&amp;<Base64-encoded data&amp;>", "filename":"filename"} where data is a Base64-encoded string of the binary data to be downloaded.
uploadShows the upload file popup.

A server-side uiSet (not a scope uiSet) must be executed to allow the upload and specify the upload path:
uiSet("<object ID>", "path", "<upload path>")
* name: the object ID
* upload path: the path where the uploaded files are saved, relative to the HSYCO main directory

When the upload is completed, a command is generated with:
* name: the object ID
* parameter: the uploaded file name, including the extension.
submitSends the values of all the fields within the button's container to the server.

If not in a container, it submits all fields from the page.

In overlay pages, if the button is not inside a container, it submits fields from the current page as well.

Fields inside nested containers are included in the submissions.

When submitting, if a field is not valid, it will be focused and the action will be canceled.
timerOpens a timer's details.
tabShows a specified container and hides the other of the same group.
camera-linkOpens a page with the specified camera address.
docs-linkOpens the documentation page with the specified root and path.
sliderOpens a slider popup.
menuOpens a popup menu.
logoutImmediately logs out the user.

Specifies a page, navigation command or external URL to follow.

Attribute Values
ValueDescriptionExample
<Page ID>The page ID.
<URL>A url starting with "http://", "https://", "ftp://" or "www.".
backNavigate backward in browsing history.
forwardNavigate forward in browsing history.
closeCloses the last opened popup.
close-allCloses all open popups.
<comma-separated list>Consequently opens a list of links.
Useful for example to open multiple modals in sequence, or to open a page and then a popup.
close-all,mymodal

Specifies where to open the linked URL. Available only for URL links.

The default value is: _self.

Attribute Values
ValueDescription
_selfDefault value. Opens the linked URL in the same window or tab.
_blankOpens the linked URL in a new window or tab.
<string>Opens the linked URL in a named window or tab. Use this to open multiple links in the same window or tab.

Datapoint

Specifies a datapoint, to display and control its status.

Attribute Values
ValueDescriptionExample
[datapoint address]The datapoint address.dummy.dimmer.1

Name

Specifies the command name that is sent to the server.

If the name starts with $, then the server will automatically set a variable with the same name as the command, containing the command's parameter.

The default value is: =id.

Attribute Values
ValueDescriptionExample
<string>A command name.
$[variable name]A command name that sets a variable.$myvar
$[variable name]!A command name that sets a persistent variable.$myvar!

Parameter

Specifies the command parameter that is sent to the server.

Attribute Values
ValueDescription
<string>A command parameter.

Repeat

If enabled, the command will be repeated every second. Down/Repeat/Up/Stop commands are sent.

The default value is: false.

Attribute Values
ValueDescription
falseDefault value. Repeat mode is disabled.
trueRepeat mode is enabled.

Path

Specifies the path where uploaded files are saved. If this attribute is not set, the upload has no effect (no files saved on the server).

For security reasons, this UISET must be executed on the server-side code (EVENTS, JavaScript or Java). A client-side UISET would be ignored.

note

This attribute is live. It can't be set from the Project Editor, it needs to be set dynamically with a UISet.

Attribute Values
ValueDescriptionExample
<string>Path..tmp

Multiple

Specifies wether multiple files can be selected.

The default value is: false.

Attribute Values
ValueDescription
falseDefault value. Single file selection.
trueMultiple file selection.

Accept

Specifies the types of files that the server accepts.

The default value is: [any].

Attribute Values
ValueDescriptionExample
[empty]No restrictions.
<comma-separated list>File extensions..jpg,.png,.gif

Preview

Specifies wether a preview step is displayed.

The default value is: false.

note

This attribute is experimental. It might not work properly and it might be modified or removed in a future release.

Attribute Values
ValueDescription
falseDefault value. No preview.
truePreview.

Camera

Specifies a camera, to display its live video stream.

Attribute Values
ValueDescriptionExample
<camera address>The camera address.dummy.camera.1

Target Camera

Specifies a target camera object, to display the camera live video stream.

If not specified, a default camera object is displayed in a popup.

Attribute Values
ValueDescriptionExample
[empty string]The camera is displayed in a popup.
<Container ID>The container object's ID.mycontainer

Docs Target

Specifies a target docs object, to display the documentation.

If not specified, a default docs object is displayed in a popup.

The default value is: default.

Attribute Values
ValueDescriptionExample
defaultDefault value. The documentation is displayed in a popup.
<Docs ID>The docs object's ID.mydocs

Doc Type

Specifies the type of documentation.

The default value is: project.

Attribute Values
ValueDescription
projectDefault value. Project documentation.
hsycoHSYCO documentation.
projectsAll projects documentation.
objectsCustom objects documentation.

Docs Root Path

Root path of the documentation.

If left empty it loads all the project documentation.

If a path is specified it loads the documentation from that path.

The path is relative to the project docs directory: www/projects/<project id>/docs.

The contents of the docs directory are merged with the common docs directory: www/docs.

The common docs should include documentation that is shared among multiple projects, while project-specific docs should be placed in the project's docs directory.

Attribute Values
ValueDescriptionExample
<string>Path.my/sub/dir

Docs Path

Current path of the docs file displayed, following the same directory structure as the root path.

Can contain an anchor to a specific section of the document, using the format path#anchor.

Each heading in the document has an anchor with an id equal to the heading text in lowercase, with no spaces. E.g. My Heading becomes #myheading.

Attribute Values
ValueDescriptionExample
<string>Path.projects/home

Index

Specifies wether the index is displayed.

The default value is: toggle.

Attribute Values
ValueDescription
trueVisible.
falseHidden.
toggleDefault value. User can toggle visibility.
toggle-falseUser can toggle visibility, but it's hidden by default.

TOC

Specifies wether the table of contents is displayed.

The default value is: toggle.

Attribute Values
ValueDescription
trueVisible.
falseHidden.
toggleDefault value. User can toggle visibility.
toggle-falseUser can toggle visibility, but it's hidden by default.

Specifies wether the breadcrumbs are displayed.

The default value is: true.

Attribute Values
ValueDescription
falseHidden.
trueDefault value. Visible.

Timer

Specifies a timer, to display its details and command it.

Attribute Values
ValueDescriptionExample
<timer address>The timer address.dummy.timer.1

Target Container

Specifies a target container, to display its content.

Attribute Values
ValueDescriptionExample
<container ID>The container ID.dummy.container.1

Tab Group

Specifies the tab group to which the tab belongs.

Attribute Values
ValueDescription
<string>The tab group name.

Slider Action

Specifies the action to perform when the slider is moved.

The default value is: none.

Attribute Values
ValueDescription
noneDefault value. No action.
commandSends a command.
datapointSets a datapoint value.
dmxSets a DMX value.

Slider Orientation

Specifies the orientation of the slider.

The default value is: horizontal.

Attribute Values
ValueDescription
horizontalDefault value. Horizontal.
verticalVertical.

Slider Display Value

Specifies if the slider value is displayed.

The default value is: false.

Attribute Values
ValueDescription
falseDefault value. The slider value is not displayed.
trueThe slider value is displayed.

Slider Name

Specifies the name of the command to send.

The default value is: =id.

Attribute Values
ValueDescription
<string>A command name.

Slider Address

Specifies the address of the DMX to set.

Attribute Values
ValueDescription
<string>A DMX address.

Slider Datapoint

Specifies the datapoint to set.

Attribute Values
ValueDescription
<datapoint address>A datapoint address.

Specifies the menu items.

Attribute Values
ValueDescription
<json>Menu item.

Feedback

If feedback is enabled, when the action is performed, a loader is displayed until the server responds.

Also the action can't be performed again until the server responds.

The default value is: false.

Attribute Values
ValueDescription
falseDefault value. Feedback is disabled.
trueFeedback is enabled.

Confirm

Requires a confirmation before performing the action.

The default value is: false.

Attribute Values
ValueDescription
falseDefault value. No confirmation, the action is performed right away.
doubleclickA second click (or touch or enter key) is required to confirm the action.
popupA popup is displayed to ask for confirmation.

Confirm Message

The confirmation message to be displayed if the "confirm" attribute is set to "popup".

Attribute Values
ValueDescriptionExample
<string>The message to be displayed in the confirm popup.Are you sure?

Layout

Color

Specifies the button color.

The default value is: default.

Attribute Values
ValueDescription
defaultDefault value. Default color.
primaryPrimary color, used to highlight action buttons.
warningWarning color, used to highlight warning buttons.
successSuccess color, used to highlight success buttons.
errorError color, used to highlight error buttons.
lightLight color.
darkDark color.
red,blue,yellow,green,yellow,purple,orange,greenPalette colors.
customCustom color, defined in the "Custom Color" attribute.

Custom Color

Specifies the button's custom color.

Attribute Values
ValueDescription
<html color>Any valid HTML color.

Look

Specifies the button's look.

The default value is: filled.

Attribute Values
ValueDescription
filledDefault value. Filled look, with a solid background.
clearClear look, no background or border.
outlinedOutlined look, with a solid border.
glassGlass look, with a semi-transparent background.

Shape

Specifies the button's shape.

The default value is: default.

Attribute Values
ValueDescription
defaultDefault value. Default shape.
roundedRounded shape.
pillPill or circle shape.
rectangleRectangle shape.

Label

Specifies the button's label.

Attribute Values
ValueDescription
<string>Button's label.

Label Format

Specifies the label's format.

Description

Specifies a description displayed below the label.

Attribute Values
ValueDescription
<string>Button's description.

Tooltip

A text displayed when hovering over the object, commonly used to display additional information.

Attribute Values
ValueDescriptionExample
<string>Text to be displayed.Set phasers to stun

Padding

Specifies the padding of the button. The padding is the space between the content of the button and its border.

The default value is: auto.

Attribute Values
ValueDescriptionExample
<int>Specify the padding in pixels for all sides of the object.
<top> <right> <bottom> <left>Specify the padding in pixels for each side of the object.10 20 30 40

Gap

Specifies the gap between the label and icons.

The default value is: auto.

Attribute Values
ValueDescription
<int>Gap in pixels.

CSS Style

note

This attribute has been deprecated since ver. 4.0

Icon

Icon

Specifies an icon to display. Its position is set with the "Icon Position" attribute.

Attribute Values
ValueDescription
<icon>An icon or image.

Icon Position

Specifies the position of the icon.

The default value is: auto.

Attribute Values
ValueDescription
autoDefault value. Equals "center" if an icon is specified, but there's no label. Equals "left" if both an icon and a label are specified. Otherwise, equals "none".
noneNo icon. The label is centered.
leftPlace the icon on the left of the label.
topPlace the icon on top of the label.
centerPlace the icon in the center, hiding the label.
backgroundPlace the icon in the center, behind the label.

Icon Color

Specifies the icon's color.

Attribute Values
ValueDescriptionExample
<html color>Color in any html accepted format.#ff0000

Icon Size

Specifies the icon's size.

The default value is: auto.

Attribute Values
ValueDescriptionExample
<int>Size in pixels.10

Icon Fit

Specifies how the image should be resized to fit its container.

The default value is: contain.

Attribute Values
ValueDescription
fillThe image is resized to fill the given dimension. If necessary, the image will be stretched or squished to fit.
containDefault value. The image keeps its aspect ratio, but is resized to fit within the given dimension.
coverThe image keeps its aspect ratio and fills the given dimension. The image will be clipped to fit.
noneThe image is not resized.
scale-downThe image is scaled down to the smallest version of none or contain.

Secondary Icon

Specifies a secondary icon to display. Its position depends on the "Icon Position" attribute.

Attribute Values
ValueDescription
<icon>An icon or image.

Secondary Icon Color

Specifies the secondary icon's color.

Attribute Values
ValueDescriptionExample
<html color>Color in any html accepted format.#ff0000

Secondary Icon Size

Specifies the secondary icon's size.

The default value is: auto.

Attribute Values
ValueDescriptionExample
<int>Size in pixels.10

Secondary Icon Fit

Specifies how the image should be resized to fit its container.

The default value is: contain.

Attribute Values
ValueDescription
fillThe image is resized to fill the given dimension. If necessary, the image will be stretched or squished to fit.
containDefault value. The image keeps its aspect ratio, but is resized to fit within the given dimension.
coverThe image keeps its aspect ratio and fills the given dimension. The image will be clipped to fit.
noneThe image is not resized.
scale-downThe image is scaled down to the smallest version of none or contain.

Action

States

Specifies attribute values for each datapoint state value.

note

This attribute is experimental. It might not work properly and it might be modified or removed in a future release.

Specifies the font family.

The default value is: default.

note

This attribute is experimental. It might not work properly and it might be modified or removed in a future release.

Specifies the font size in pixels or percentage (relative to the project's font size).

The default value is: 14.

note

This attribute is experimental. It might not work properly and it might be modified or removed in a future release.

Attribute Values
ValueDescriptionExample
<integer>Font size in pixels.
<percentage>%Relative font size in percentage.90%

Specifies the text CSS color.

note

This attribute is experimental. It might not work properly and it might be modified or removed in a future release.

Attribute Values
ValueDescriptionExample
<html color>Color in any html accepted format.#ff0000

Specifies the weight of the font.

The default value is: normal.

note

This attribute is experimental. It might not work properly and it might be modified or removed in a future release.

Attribute Values
ValueDescription
normalDefault value. Normal.
boldBold.
bolderBolder.
lighterLighter.

Show the text in italics.

The default value is: false.

note

This attribute is experimental. It might not work properly and it might be modified or removed in a future release.

Attribute Values
ValueDescription
falseDefault value. Normal.
trueItalics.

Sets the font to small caps.

The default value is: false.

note

This attribute is experimental. It might not work properly and it might be modified or removed in a future release.

Attribute Values
ValueDescription
falseDefault value. Normal.
trueSmall caps.

Specifies the text decoration.

The default value is: none.

note

This attribute is experimental. It might not work properly and it might be modified or removed in a future release.

Attribute Values
ValueDescription
noneDefault value. No decoration.
underlineUnderline.
overlineOverline.
line-throughLine through.

Sets the line height of the text.

The default value is: 1.0.

note

This attribute is experimental. It might not work properly and it might be modified or removed in a future release.

Attribute Values
ValueDescription
<float>Specify the line height as a multiple of the font size.

Badge

Badge

Shows an element in the top right corner, useful for notifications.

The default value is: false.

Attribute Values
ValueDescription
falseDefault value. Hides the element.
trueShows the element.

Badge Label

Specifies a label for the badge.

Attribute Values
ValueDescription
<string>Label.

Badge Icon

Specifies an icon for the badge.

Attribute Values
ValueDescription
<icon>An icon or image.

Badge Color

Specifies the badge color.

Attribute Values
ValueDescription
<color>Badge color.

Badge Font Color

Specifies the badge's font color.

Attribute Values
ValueDescription
<color>Font color.

Badge Icon Color

Specifies the badge's Icon Color color.

Attribute Values
ValueDescription
<color>Icon Color color.

Label

Font Family

Specifies the font family.

The default value is: default.

Font Size

Specifies the font size in pixels or percentage (relative to the project's font size).

The default value is: 14.

Attribute Values
ValueDescriptionExample
<integer>Font size in pixels.
<percentage>%Relative font size in percentage.90%

Font Color

Specifies the text CSS color.

Attribute Values
ValueDescriptionExample
<html color>Color in any html accepted format.#ff0000

Font Weight

Specifies the weight of the font.

The default value is: normal.

Attribute Values
ValueDescription
normalDefault value. Normal.
boldBold.
bolderBolder.
lighterLighter.

Italic

Show the text in italics.

The default value is: false.

Attribute Values
ValueDescription
falseDefault value. Normal.
trueItalics.

Small Caps

Sets the font to small caps.

The default value is: false.

Attribute Values
ValueDescription
falseDefault value. Normal.
trueSmall caps.

Decoration

Specifies the text decoration.

The default value is: none.

Attribute Values
ValueDescription
noneDefault value. No decoration.
underlineUnderline.
overlineOverline.
line-throughLine through.

Text Align

Sets the horizontal alignment of the text.

The default value is: none.

Attribute Values
ValueDescription
noneDefault value. No alignment.
leftLeft alignment.
rightRight alignment.
centerCenter alignment.
justifyJustified alignment.

Line Height

Sets the line height of the text.

The default value is: 1.0.

Attribute Values
ValueDescription
<float>Specify the line height as a multiple of the font size.

Label CSS

note

This attribute has been deprecated since ver. 4.0

View

Visible

Sets the object's visibility.

The default value is: true.

Attribute Values
ValueDescription
trueDefault value. Visible.
falseHidden.

Enabled

Specifies if the object is enabled or disabled. A disabled object appears as grayed out and can't be interacted with.

The default value is: true.

Attribute Values
ValueDescription
trueDefault value. Enabled.
falseDisabled.

Blinks the object at the specified speed.

The default value is: false.

Attribute Values
ValueDescription
falseDefault value. Not blinking.
slowBlinks slowly.
fastBlinks fast.

Transition

Specifies the transition effect when the object is shown or hidden.

The default value is: none.

note

This attribute is experimental. It might not work properly and it might be modified or removed in a future release.

Attribute Values
ValueDescription
noneDefault value. No transition.
fadeFade in/out.
fade-leftSlide from left and fade in/out.
fade-rightSlide from right and fade in/out.
fade-upSlide from top and fade in/out.
fade-downSlide from bottom and fade in/out.
slide-leftSlide from left.
slide-rightSlide from right.
slide-upSlide from top.
slide-downSlide from bottom.
zoom-inZoom in.
zoom-outZoom out.
3d-flip-left3D flip from left.
3d-flip-right3D flip from right.

Transition Duration

Specifies the transition duration in milliseconds.

The default value is: 300.

note

This attribute is experimental. It might not work properly and it might be modified or removed in a future release.

Attribute Values
ValueDescription
<integer>Duration in milliseconds.

Transition Delay

Specifies the transition delay in milliseconds.

The default value is: 0.

note

This attribute is experimental. It might not work properly and it might be modified or removed in a future release.

Attribute Values
ValueDescription
<integer>Delay in milliseconds.

Opacity

Sets the object's opacity. Opacity is the degree to which content behind an object is hidden.

The default value is: 1.0.

Attribute Values
ValueDescription
0The object is fully transparent.
>0.0, <1.0The object is translucent (content behind the element can be seen).
1.0Default value. The object is fully opaque.

Rotation

Specifies the degrees by which the object is rotated. A positive number rotates it clockwise, while a negative value rotates it counter-clockwise.

The default value is: 0.

CSS Class

Specifies a CSS Class that applies to the object, useful to customize its appearance. Custom CSS Classes are specified within the custom.css file.

Margin

Specifies the margin of the object. The margin is the space outside the object's border.

note

This attribute is experimental. It might not work properly and it might be modified or removed in a future release.

Attribute Values
ValueDescriptionExample
<int>Specify the margin in pixels for all sides of the object.
<top> <right> <bottom> <left>Specify the margin in pixels for each side of the object.10 20 30 40

View Scale

Specifies the scale of the object. The scale is the ratio between the object's size and the size of the view it is contained in.

The default value is: 1.0.

note

This attribute is experimental. It might not work properly and it might be modified or removed in a future release.

Attribute Values
ValueDescription
<float>Specify the scale for both width and height of the object.

Meta

Comment

Specifies a comment, visible only in the Project Editor. It can be used to add a note or a tag to the object. The filter in the object's SELECT panel applies to the comment as well.

note

This attribute is static. Its value can't be changed dynamically with a uiSet command or with a value binding.

Exclude

Excludes the object from the UI. Useful to temporarily hide an object without deleting it. Different from the "Visible" attribute, which hides the object in the UI but keeps it in the project, allowing it to be shown again with a UISet.

The default value is: false.

note

This attribute is static. Its value can't be changed dynamically with a uiSet command or with a value binding.

Attribute Values
ValueDescription
falseDefault value. Object is included in the UI.
trueObject is excluded from the UI.