Widget catalogue
Each family has a guide page (what each widget is for, how to use it, an example) and a generated API page (every public constructor, method and callback, read from the source).
| Family | Guide | API |
|---|---|---|
| Core: Component, Panel, Label, Button, IconButton, Image, Tooltip, ScrollBar, ScrollPanel | Core widgets | API |
| Display: Badge, ProgressBar, MeterBar, RichText, AnimatedImage, StatWeb, Toast, Spacer | Display widgets | API |
| Interactive: Toggle, Checkbox, Radio, Slider, Select, OptionRotator, ToggleButtonBar, menus, Popover, ToolBar, DragHandle, pickers | Interactive widgets | API |
| Text: TextInput, TextArea, MaskedInput, InputField, SearchBox, NumberStepper, Tag, TagBar, ColorPicker | Text widgets | API |
| Containers: Window, TabBar, lists, trees, Accordion, NavDrawer, layouts | Containers | API |
| Composites: DataTable, GradientEditor | Composites | API |
What every widget shares
All widgets extend Component, so these work everywhere:
| Method | Use |
|---|---|
setPosition(x, y), setSize(w, h) | Place and size it. In a Window body a placed child leaves the flow and its siblings keep flowing; other layout parents may override the position. |
setEnabled(v), bindEnabled(ref) | Disable it, or follow a Ref<boolean>. |
setVisible(v), bindVisible(ref) | Hide it, or follow a Ref<boolean>. |
setVariant(v) | Pick a theme variant (VARIANT_PRIMARY, VARIANT_DANGER and so on). |
setTheme(theme) | Give it (and its children) an explicit theme. |
setTooltipText(text, family, size) | A one-line tooltip on hover. |
setContextMenu(menu) | A right-click menu. |
setOnActivate(fn) | Called when it, or a child, is clicked. |
dispose() | Free it and everything it owns. |
Most constructors take a name first, then, for widgets that show text, a font family ("default") and a size in pixels.
Every widget in XML
Each widget's XML tag, with its attributes and events, is in the tag reference.