UI & Widgets
Appmixer UI is a tool for building user interfaces with component-based widgets.
Widgets are included in
appmixer.ui
instances made with Appmixer constructor:const appmixer = new Appmixer(/* ... */)
const widget = appmixer.ui.FlowManager(config)
Type:
String|Element
| Default: null
HTML DOM element to serve as a container of the widget.
Type:
Object
| Default: DefaultTheme
Custom theme definition.
Type:
Object
| Default: DefaultL10N
Custom localization texts.
Type:
String
| Default: en
Language code for localization of components.
Type:
Object
| Default: DefaultAPI
Custom API methods.
widget.open()
Mount the
widget
instance and render it inside the el
container.widget.close()
Unmount the
widget
instance and hide the el
container.widget.reload()
Reload the entire
widget
.widget.reset()
Reset the state of the widget to defaults.
Use
state
for properties that may change at any time when the widget
is active.widget.state(path, value) // setter
widget.state(path) // getter
{
"foo": false,
"bar": { "counter": 1 }
}
// set properties by key or path
widget.state('foo', true)
widget.state('bar', { counter: 2 })
widget.state('bar/counter', 3)
// get properties by key or path
widget.state('foo') // true
widget.state('bar') // { counter: 3 }
widget.state('bar/counter') // 3
// get the entire state
widget.state() // { foo: true, bar: { counter: 3 } }
// reset the state to defaults
widget.reset() // { foo: false, bar: { counter: 1 } }
widget.set(key, value)
Set
config
property.widget.get(key, value)
Get
config
property.widget.on(name, handler)
Add a new event listener and disable the default handler of the event.
widget.off(name)
Remove an event listener and enable the default handler of the event.
Last modified 4mo ago