IconPicker provides a Promise-based icon selection dialog. output: 'svg' returns a complete SVG string, while output: 'code' returns a compact object containing the icon code, color, and size. Cancellation, closing, or invocation during server rendering returns undefined.
Passing size fixes the output dimensions. If it is omitted, the user can choose a size from 8–256 px directly in the dialog.
The default catalog contains 168 candidate names without SVG payloads. IconPicker accepts registered data or an API and does not require a public service. However, default api: true retrieves missing data from public Iconify. For restricted networks, review data sources, use a self-hosted API, or prepare offline icons.
import { SIconPicker } from 'sax-design-vue'
const svg = await SIconPicker({
title: 'Insert icon',
output: 'svg',
color: '#5667F4',
showAlpha: true,
})
if (svg) editor.insertHtml(svg)
const icon = await SIconPicker({ output: 'code' })
// { code: 'cb:rocket', color: '#5667F4', size: 24 }