Icons

ScriptWeaver bundles 126 stroke-style icons (mostly Feather Icons, MIT, plus a grip-vertical drag handle), rendered on demand as crisp, DPI-scaled images in any colour. No asset files to ship — they come with the Player.

const save = sw.icons.get('save');
app.Button({ text: 'Save', image: save, compound: 'left' });

compound controls where the icon sits relative to the text (left, right, top, bottom) — or omit text for an icon-only button. Icons work wherever an image is accepted: image: options on buttons, labels, menu entries, notebook tabs, treeview items…

Picking colour and size

sw.icons.get('trash', { color: 'danger' }); // a theme colour keyword
sw.icons.get('check', { color: '#1db954' }); // or any hex
sw.icons.get('search', { size: 24 }); // square pixels, default 16

The default colour is the active theme's foreground, so plain icons match the text around them. Theme colour keywords (primary, success, danger, … — see Theming) resolve against the active theme at get() time; after app.setTheme() call get() again for icons that should follow the new palette (handles are cached, so this is cheap — an unchanged colour returns the same image).

The catalog

sw.icons.names; // ['arrow-down', 'arrow-left', …] — 126 names, sorted

A quick browser, ten per row:

const grid = app.Grid({ columns: 10, gap: 4, padding: 8 });
grid.pack.configure({ fill: 'both', expand: true });
sw.icons.names.forEach((n) =>
  grid.add(app.Button({ image: sw.icons.get(n, { size: 20 }) })),
);

An unknown name throws, listing nothing silently. Handles are plain frozen values managed by the Player — create them freely, never destroy them.

Next