Skip to main content

Button

The Button widget is a clickable button that runs the action you specify when a reader presses it.
Use it for every action trigger on a screen — confirm, cancel, navigate, and more.

info

Example file: 07_Work_with_Widgets/button_objet.lfp

Definition and role

The Button widget draws a pressable area that holds text and, optionally, an icon. Press it and the action wired to onClick runs. Configure the background color, the border, the corner radius, the size, and the icon position.

  • Category: Contents (input and selection)
  • Default text: Button
  • Default size: width 100, height 50
  • Default background color: #009DFF

Features

FeatureDescription
Click actionPress the button and the action (logic or script) wired to onClick runs.
Text and backgroundSet the displayed text and the background color. The text supports data binding.
Icon displayPlace an icon next to the text and set its position — top, left, right, or bottom.
AppearanceAdjust the size, alignment, padding, border, and corner radius.

How to use

  1. Open the Contents category in the left widget palette.
  2. Drag and drop the Button item onto the canvas.
  3. In the Properties panel on the right, change text to the label you want.
  4. Wire the action (logic or script) that runs on click to onClick.
  5. Adjust the background color (fillColor), the icon, and the size if you need to.

Properties

note

Set detailed text styles, such as font color and size, in the shared Style settings. The properties below are specific to Button.

PropertyDescriptionDefaultValue / Type
SizeButton size — a grouped property that sets width and height togetherWidth 100, height 50Size (width and height, number in px)
alignmentAlignment of the content inside the buttonCenterAlignment value
paddingInner padding of the button0Padding value
borderBorderWhite, 1pxBorder value
radiusCorner radiusNot setRadius value
fillColorButton background color#009DFF (blue)Color
textString shown on the button (supports data binding)ButtonString
textStyleText style (color, size, weight, and more)Not setText style
iconPaddingIcon padding0Padding value
iconDirectionIcon position relative to the textlefttop, left, right, bottom
iconIcon to place on the button (optional)NoneIcon settings

Notes and tips

note

For the button to actually respond, wire an action to onClick. With no action wired, pressing the button does nothing.

tip

Set the font color and size in textStyle (the shared Style settings). Once an icon is on, use iconDirection to move it relative to the text.

Learn more

tip

For the complete Widget Control (Property, Method, and Event) that drives this widget from a script, visit Button Widget Control.