Skip to main content

Toolbar API

Initialization

<script>
import { Toolbar } from "wx-svelte-toolbar";

const items = [
{ id: "label", text: "My App" },
{ comp: "spacer" },
{
id: "search",
comp: "button",
icon: "wxi-search",
css: "right",
},
];

function handler(ev) {
console.log(`item ${ev.detail.id} was clicked`);
}
</script>

<Toolbar {items} on:click={handler} />
  • Visit the Features Guide to learn more about the widget's functionality.
  • Explore the samples to visualize the available features.

Properties

cssSets a CSS class for the top container of the Toolbar.
itemsDefines items such as buttons, icons, and labels within the toolbar.
menuCssDefines a CSS class for the top container of the popup menu.
overflowControls how the toolbar handles items that can't fit on the screen.
valuesSets and retrieves the current values of controls inside the toolbar.

Events

changeTriggers when the value of a control in the toolbar changes.
clickTriggers when a control element is clicked.

Helpers

registerToolbarItemRegisters custom components as elements in the toolbar.