Button
Button
Clickable control with focus, sizing, and events.
Quick Start
Tip: State and Events
Use view @state fields to drive text, colors, and visibility. Handle interactions via .onClick((event)).
How It Works
- Text, icon, and background are composed internally.
- Width/height auto-measure from text when set to 0.
- OK key triggers
.onClickwhen active; inactive buttons swallow OK.
Notable State Fields
text: stringisActive: booleanisSelected: booleanexpandOnFocus: boolean(auto-collapse/expand)iconUri: stringcolor,backgroundColor,iconColortitleFontKey: stringwidth,height(layout)onClick(event)
Event Type
type ButtonEvent = { view: ButtonView; type: 'click'; preventDefault: boolean };