How to use the @iconify/iconify.getIcon 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 / src / components / iconify / footer / full.jsx View on Github external
renderIconName() {
		let props = this.props;

		let app = props.app,
			options = app.options,
			iconName = props.iconName,
			showPrefix =
				!props.view ||
				props.view.type !== 'collection' ||
				props.view.prefix !== options.icon.prefix,
			text = showPrefix ? iconName : options.icon.name,
			data = Iconify.getIcon(iconName),
			sampleHeight = props.container.scaleDownIcon(data.height), // ignore other attributes because rotation is not applied
			sample = FullFooter.renderSample(iconName, {});

		return (
			
		);
	}
github iconify / iconify-figma / ui / src / components / iconify / parts / icon.jsx View on Github external
.replace('{prefix}', icon.prefix)
			.replace('{name}', icon.name);

		if (!loaded) {
			return (
				
			);
		}

		let iconData = Iconify.getIcon(name);

		let tooltip = [
			lang.name.replace('{name}', props.title),
			lang.size
				.replace('{width}', iconData.width)
				.replace('{height}', iconData.height),
			lang.palette.replace(
				'{palette}',
				iconData.body.indexOf('currentColor') === -1
					? lang.colors
					: lang.colorless
			),
		];
		tooltip = tooltip.join('\n');

		// Generate SVG
github iconify / iconify-figma / ui / src / components / iconify / parts / icon-long.jsx View on Github external
if (!loaded) {
			return (
				
					{deleteButton}
				
			);
		}

		let icon = props.icon,
			iconData = Iconify.getIcon(name);

		// Generate link and tooltip
		let link = props.config.links.icon
			.replace('{prefix}', icon.prefix)
			.replace('{name}', icon.name);

		let tooltip = [
			lang.name.replace('{prefix}', icon.prefix).replace('{name}', icon.name),
			lang.size
				.replace('{width}', iconData.width)
				.replace('{height}', iconData.height),
			lang.palette.replace(
				'{palette}',
				iconData.body.indexOf('currentColor') === -1
					? lang.colors
					: lang.colorless
github iconify / iconify-figma / ui / src / components / container.jsx View on Github external
if (event && event.preventDefault) {
			event.preventDefault();
		}

		// Get selected icon
		if (options && options.iconName !== void 0) {
			iconName = options.iconName;
			delete options.iconName;
		}
		if (iconName === null) {
			return;
		}

		// Get icon data
		let iconData = Iconify.getIcon(iconName);
		if (!iconData) {
			return;
		}

		// Add icon to recent list
		let ui = this.props.ui;
		ui.storeIcon('recent', iconName);

		if (
			this.route.page === 'recent' &&
			this.iconifyView &&
			this.iconifyView.sync
		) {
			this.iconifyView.sync();
		}
github iconify / iconify-figma / ui / src / components / iconify / footer / full.jsx View on Github external
render() {
		let props = this.props,
			container = props.container;

		let app = props.app,
			iconName = props.iconName,
			data = Iconify.getIcon(iconName),
			options = app.options,
			transformations = options.getIconTransformations(true),
			sample = FullFooter.renderSample(iconName, transformations),
			sampleHeight = container.scaleDownIcon(
				data.height,
				data.width,
				transformations.rotate
			),
			sampleLimit = 128,
			hasColor = sample.indexOf('currentColor') !== -1;

		// Change color in sample
		if (hasColor && transformations.color !== '') {
			sample = sample.replace(/currentColor/g, transformations.color);
		}

@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