Icon
Semantic vector graphics.
Examples
Basic
Svant offers a list of icons that you can import from svant/icons
, there are components for icons with different themes, you can use spin
to animate the icon, and rotate
to rotate it.
Two-tone icons
You can set twoToneColor
prop to specific primary color for two-tone icons.
Custom Icon
Common Attributes
Property | Description | Type | Default |
---|---|---|---|
class | Class of Icon | String | Object | - |
style | Style properties of icon, like fontSize and color | String | Object | - |
spin | Rotate icon with animation | Boolean | false |
rotate | Rotate by n degrees (not working in IE9) | Number | - |
twoToneColor | Only supports the two-tone icon. Specify the primary color. | String (hex color) | - |
If you are using the Icon
component these are additional attributes besides the above
Custom Icon attributes
Property | Description | Type | Default |
---|---|---|---|
component | SvelteComponent containing svg | SvelteComponent | - |
Events
Name | Description |
---|---|
click | Specify a function that will be called when a user clicks the icon. |