TigriWeb Components
AttributesControlsMetaPrimitivesIntegrations
  • Table of Contents
  • Attributes
    • Checkbox
    • Color
    • ColorGradient
    • DateTime
    • Icon
    • Media
    • Number
    • PostType
    • PostTypeMultiple
    • Radio
    • Range
    • Select
    • Taxonomy
    • TaxonomyMultiple
    • Text
    • Textarea
    • Toggle
    • ToolbarButton
    • ToolbarGroup
  • Controls
    • AppenderButton
    • Media
    • RichHeading
    • RichText
  • Meta
    • Checkbox
    • Color
    • DateTime
    • Icon
    • Media
    • Number
    • PostType
    • PostTypeMultiple
    • Radio
    • Range
    • Select
    • Taxonomy
    • TaxonomyMultiple
    • Text
    • Textarea
    • Toggle
  • Primitives
    • HTML
    • SVG
  • Integrations
    • Enqueue SVG icons
    • Enqueue I18n strings
Powered by GitBook
On this page

Was this helpful?

  1. Primitives

SVG

PreviousHTMLNextIntegrations

Last updated 6 months ago

Was this helpful?

{icon, size, stroke}
/**
 * @param {string} icon - Icon identifier/key.
 * @param {number} [size] - Icon size (default: 24).
 * @param {number} [stroke] - Icon stroke (default: 1.5).
 */
block.json
"testIcon": {
	"type": "string",
	"default": "map-pin-heart"
},
index.js
import {
	TwebSVG,
} from '@tigriweb/components/primitives';
index.js | edit()
<TwebSVG
	icon={ attributes.testIcon }
	size={ 24 }
	stroke={ 1.5 }
/>

Important: You Need to Globally!

TwebSVG
Enqueue Icons