WebRADDocumentationExplore WebRAD ↗
WEBRAD / TECHNICAL REFERENCE

Button

Button with a caption, icon, and click event.

WebButtonStandardVisual5 events

Quick start

Add Button1 in the Designer. Use the example in a page method.

Button1 · event
Button1.caption = 'Save';
Button1.enabled = true;
Button1.onClick = async (sender) => {
  sender.enabled = false;
  try { Message('Saved'); }
  finally { sender.enabled = true; }
};
// Button1.click();
  • Configure caption and icon in the Inspector.
  • Link the action in Interaction → OnClick. Use enabled to prevent further activation during a task.
  • click() activates the button from code. For a button with only a Lucide icon, use Icon.

Inspector properties

Component options and defaults. Fields without runtime access are configured in the Inspector.

Property / sourceType and optionsDefaultRuntime access
nameName · Identitystring—name
xLeft · Size & positionnumber0x
yTop · Size & positionnumber0y
widthWidth · Size & positionnumber100width
heightHeight · Size & positionnumber36height
itemWidthResponsive width · Responsive sizeFit content grows the item to its widest rendered child and preserves child intrinsic widths; minimum and maximum width remain limits.enumfixed stretch fit-content"fixed"Inspector / configuration
itemHeightResponsive height · Responsive sizeFit content grows the item to its lowest rendered child and preserves child intrinsic heights; minimum and maximum height remain limits.enumfixed stretch fit-content"fixed"Inspector / configuration
itemMinWidthMinimum width · Responsive sizenumber0Inspector / configuration
itemMaxWidthMaximum width · Responsive sizenumbernullInspector / configuration
itemMinHeightMinimum height · Responsive sizenumber0Inspector / configuration
itemMaxHeightMaximum height · Responsive sizenumbernullInspector / configuration
itemGrowGrow · Responsive sizenumber0Inspector / configuration
itemShrinkShrink · Responsive sizeAllows fixed and stretch flow items to yield space. Fit-content keeps its intrinsic size so its children are not compressed.booleantrueInspector / configuration
itemAlignSelfItem alignment · Responsive sizeCross-axis alignment for this item in a row or column. Auto inherits the parent alignment; responsive cross-axis stretch retains its sizing behavior.enumauto start center end stretch"auto"Inspector / configuration
itemHorizontalAnchorHorizontal anchor · Anchors & offsetsenumstart center end stretch"start"Inspector / configuration
itemVerticalAnchorVertical anchor · Anchors & offsetsenumstart center end stretch"start"Inspector / configuration
itemLeftLeft inset · Anchors & offsetsnumber0Inspector / configuration
itemRightRight inset · Anchors & offsetsnumber0Inspector / configuration
itemTopTop inset · Anchors & offsetsnumber0Inspector / configuration
itemBottomBottom inset · Anchors & offsetsnumber0Inspector / configuration
marginMargin · SpacingOuter spacing on all four sides, in pixels. Row and column layouts include this spacing between components.number0margin
marginTopMargin top · SpacingOuter spacing on this side, in pixels. Overrides the shared Margin value.number0Derived from saved propertiesmarginTop
marginRightMargin right · SpacingOuter spacing on this side, in pixels. Overrides the shared Margin value.number0Derived from saved propertiesmarginRight
marginBottomMargin bottom · SpacingOuter spacing on this side, in pixels. Overrides the shared Margin value.number0Derived from saved propertiesmarginBottom
marginLeftMargin left · SpacingOuter spacing on this side, in pixels. Overrides the shared Margin value.number0Derived from saved propertiesmarginLeft
visibleVisible · Behaviorbooleantruevisible
collapseWhenHiddenCollapse when hidden · BehaviorRemoves the component from the layout while it is not visible.booleantruecollapseWhenHidden
enabledEnabled · Behaviorbooleantrueenabled
tabIndexTabIndex · Behaviornumber0tabIndex
captionCaption · Appearancestring"Button"caption
iconIcon · AppearanceChoose the icon used by this button when its style shows an icon.icon
213 optionsadd chevron-down chevron-right close delete folder-open info layers lightbulb palette page play redo save search settings style undo arrow-left arrow-right arrow-up arrow-down chevron-left chevron-up chevrons-left chevrons-right chevrons-up chevrons-down menu more-horizontal more-vertical home external-link check check-circle check-square minus minus-circle plus-circle edit copy cut clipboard download upload refresh link unlink share send printer archive eye eye-off lock unlock filter sort-asc sort-desc warning alert-circle help-circle bell bookmark flag heart star folder file file-plus file-text text image camera database table list grid chart-bar chart-line code terminal cloud upload-cloud download-cloud user users user-plus mail phone globe map-pin calendar clock pause stop skip-back skip-forward volume-2 volume-x video login logout sign-in sign-out door-in door-out door-open door-closed key key-round shield shield-check shield-alert shield-x fingerprint badge-check id-card user-check user-x user-minus user-round contact accessibility password at-sign scan-face circle circle-dot square move maximize minimize expand shrink fullscreen panel-left panel-right panel-top panel-bottom sidebar-left sidebar-right layout columns rows align-left align-center align-right align-justify rotate-cw rotate-ccw repeat folder-plus folder-minus folder-x folder-search folder-check folder-lock file-minus file-x file-check file-code file-image file-video file-audio file-archive file-lock file-search file-copy files hard-drive server cpu monitor laptop smartphone tablet wifi bluetooth message-circle message-square messages-square message-plus message-x inbox outbox reply reply-all forward-mail paperclip attachment rss megaphone microphone microphone-off headset radio sms cart shopping-bag credit-card receipt wallet dollar-sign percent tags gift truck building briefcase target trophy toggle-right
"add"icon
currentRowBindingsCurrent row · DataBind writable visual values to fields of this repeated row.current-row-bindingsEditor: current-row-bindings[]currentRowBindings

API in code

MemberSignatureAccess
captioncaption: string;Read and write
iconicon: WebButtonIcon;Read and write
onClickset onClick(handler: WebComponentEventHandler<this> | null);Read and write

click

method
click(): void;
Example
Button1.click
Button1.click();
Inherited members (27)
MemberSignatureAccess
currentRowBindingscurrentRowBindings: readonly WebCurrentRowBinding[];Read and write
elementreadonly element: TElement;Read-only
idreadonly id: string;Read-only
namereadonly name: string;Read-only
visiblevisible: boolean;Read and write
collapseWhenHiddencollapseWhenHidden: boolean;Read and write
enabledenabled: boolean;Read and write
xx: number;Read and write
yy: number;Read and write
widthwidth: number;Read and write
heightheight: number;Read and write
marginOuter spacing on all four sides, in pixels.margin: number;Read and write
marginTopmarginTop: number;Read and write
marginRightmarginRight: number;Read and write
marginBottommarginBottom: number;Read and write
marginLeftmarginLeft: number;Read and write
alignSelfalignSelf: RuntimeLayoutAlignSelf;Read and write
tabIndextabIndex: number;Read and write
backgroundColorbackgroundColor: string;Read and write
colorcolor: string;Read and write
borderColorborderColor: string;Read and write

focus

method
focus(options?: FocusOptions): void;

show

method
show(): void;

hide

method
hide(): void;

bindEvent

method
bindEvent(eventName: string, handler: WebComponentEventHandler<this> | null): () => void;

emit

method
emit(eventName: string, detail?: unknown): boolean;

dispose

method
dispose(): void;

Events

Link methods in Interaction. How to use events.

OnClick

Standard event (Event).

Signature and example
Interaction → OnClick
import type { WebButton } from '@webrad/runtime';
// Copy this method into the page class and link it in Interaction.
class Example {
  public async Button1Click(
    sender: WebButton,
    event: Event,
  ): Promise<void> {
    console.log(sender.name, event.type);
  }
}

OnFocus

Standard event (Event).

Signature and example
Interaction → OnFocus
import type { WebButton } from '@webrad/runtime';
// Copy this method into the page class and link it in Interaction.
class Example {
  public async Button1Focus(
    sender: WebButton,
    event: Event,
  ): Promise<void> {
    console.log(sender.name, event.type);
  }
}

OnBlur

Standard event (Event).

Signature and example
Interaction → OnBlur
import type { WebButton } from '@webrad/runtime';
// Copy this method into the page class and link it in Interaction.
class Example {
  public async Button1Blur(
    sender: WebButton,
    event: Event,
  ): Promise<void> {
    console.log(sender.name, event.type);
  }
}

OnMouseEnter

Standard event (Event).

Signature and example
Interaction → OnMouseEnter
import type { WebButton } from '@webrad/runtime';
// Copy this method into the page class and link it in Interaction.
class Example {
  public async Button1MouseEnter(
    sender: WebButton,
    event: Event,
  ): Promise<void> {
    console.log(sender.name, event.type);
  }
}

OnMouseLeave

Standard event (Event).

Signature and example
Interaction → OnMouseLeave
import type { WebButton } from '@webrad/runtime';
// Copy this method into the page class and link it in Interaction.
class Example {
  public async Button1MouseLeave(
    sender: WebButton,
    event: Event,
  ): Promise<void> {
    console.log(sender.name, event.type);
  }
}
WebRAD · Atentor · Read in Markdown
Source code: 6a562bda75a0 (with local changes) · November 7, 2026

Search documentation

Type to search APIs, components, and events.