How to use the @iconify/iconify.setConfig function in @iconify/iconify

To help you get started, we’ve selected a few @iconify/iconify examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github iconify / iconify-figma / ui / dev-ui.js View on Github external
import UI from './src/ui';

// UI configuration
const itemsPerPage = 55; // 5 rows x 11 icons. Also see plugin-ui.js
let iconifyConfig = {
	config: {
		itemsPerPage: itemsPerPage,
		search: {
			limit: itemsPerPage * 2,
		},
	},
};

// Use local API for development. See config.common.js
if (process.env.ICONIFY_API) {
	Iconify.setConfig('defaultAPI', process.env.ICONIFY_API_VALUE);
}
if (process.env.SEARCH_API) {
	iconifyConfig.config.API = {
		URI: process.env.SEARCH_API_VALUE,
	};
}

let params = {
	callback: (event, data) => {
		console.log('Callback to plugin:', event, data);
	},

	iconify: iconifyConfig,

	// Prefix to limit plugin to one collection. Changing this might be broken by stored route and require reset of options
	// prefix: 'ic',
github iconify / iconify-figma / ui / plugin-ui.js View on Github external
if (result === null) {
		return;
	}

	// Create timer
	timer = window.setInterval(nextTick, 100);
}

// Show notice that plug-in is in development mode, not ready for publishing
if (process.env.SEARCH_DEV) {
	console.log('Running plug-in in development mode!');
}

// Disable Iconify storage
Iconify.setConfig('localStorage', false);
Iconify.setConfig('sessionStorage', false);
if (process.env.ICONIFY_API) {
	// Use local API for development. See config.common.js
	Iconify.setConfig('defaultAPI', process.env.ICONIFY_API_VALUE);
}

// Load samples
loadScript('https://code.iconify.design/samples.js');
delay(
	counter => {
		// Do not delay for more than 1 second
		return counter > 10 || Iconify.iconExists('mdi:account-check');
	},
	() => {
		let iconifyConfig = {
			config: {
				itemsPerPage: itemsPerPage,
github iconify / iconify-figma / ui / plugin-ui.js View on Github external
}
	if (result === null) {
		return;
	}

	// Create timer
	timer = window.setInterval(nextTick, 100);
}

// Show notice that plug-in is in development mode, not ready for publishing
if (process.env.SEARCH_DEV) {
	console.log('Running plug-in in development mode!');
}

// Disable Iconify storage
Iconify.setConfig('localStorage', false);
Iconify.setConfig('sessionStorage', false);
if (process.env.ICONIFY_API) {
	// Use local API for development. See config.common.js
	Iconify.setConfig('defaultAPI', process.env.ICONIFY_API_VALUE);
}

// Load samples
loadScript('https://code.iconify.design/samples.js');
delay(
	counter => {
		// Do not delay for more than 1 second
		return counter > 10 || Iconify.iconExists('mdi:account-check');
	},
	() => {
		let iconifyConfig = {
			config: {
github iconify / iconify-figma / ui / plugin-ui.js View on Github external
// Create timer
	timer = window.setInterval(nextTick, 100);
}

// Show notice that plug-in is in development mode, not ready for publishing
if (process.env.SEARCH_DEV) {
	console.log('Running plug-in in development mode!');
}

// Disable Iconify storage
Iconify.setConfig('localStorage', false);
Iconify.setConfig('sessionStorage', false);
if (process.env.ICONIFY_API) {
	// Use local API for development. See config.common.js
	Iconify.setConfig('defaultAPI', process.env.ICONIFY_API_VALUE);
}

// Load samples
loadScript('https://code.iconify.design/samples.js');
delay(
	counter => {
		// Do not delay for more than 1 second
		return counter > 10 || Iconify.iconExists('mdi:account-check');
	},
	() => {
		let iconifyConfig = {
			config: {
				itemsPerPage: itemsPerPage,
				search: {
					limit: itemsPerPage * 2,
				},
github iconify / iconify-figma / ui / src / components / container.jsx View on Github external
constructor(props) {
		super(props);

		let ui = props.ui,
			params = ui.params;

		// Set state
		this.state = {
			counter: 0,
		};

		// Disable cache for icons
		Iconify.setConfig('localStorage', false);
		Iconify.setConfig('sessionStorage', false);

		// Notices
		this.notices = [];

		// Options
		this.options = ui.options;

		// Selected nodes tree
		this.selectedNodes = params.selectedNodes ? [params.selectedNodes] : [];

		// Page and routes
		this.route =
			params.route && params.route.page
				? JSON.parse(JSON.stringify(params.route))
				: {
github iconify / iconify-figma / ui / src / components / container.jsx View on Github external
constructor(props) {
		super(props);

		let ui = props.ui,
			params = ui.params;

		// Set state
		this.state = {
			counter: 0,
		};

		// Disable cache for icons
		Iconify.setConfig('localStorage', false);
		Iconify.setConfig('sessionStorage', false);

		// Notices
		this.notices = [];

		// Options
		this.options = ui.options;

		// Selected nodes tree
		this.selectedNodes = params.selectedNodes ? [params.selectedNodes] : [];

		// Page and routes
		this.route =
			params.route && params.route.page
				? JSON.parse(JSON.stringify(params.route))
				: {
						page: 'iconify',

@iconify/iconify

Unified SVG framework with over 100,000 icons to choose from

MIT
Latest version published 1 year ago

Package Health Score

61 / 100
Full package analysis

Similar packages