SvgIcon

Media
stable

Renders an inline SVG path icon. Accepts a single path string or an array of multi-path entries with optional fill-opacity values.

Aperçu

Rendu de l’aperçu en cours…

default

Rendu de l’aperçu en cours…

large

Structure

Anatomie

Décomposition visuelle de la structure interne du composant avec les appels de classes BEM.

Anatomy of OrigamSvgIconSchematic of the SvgIcon component with 3 numbered internal parts. origam-icon--svg origam-icon__svg <svg viewBox="0 0 24 24"> <path :d="icon" /> 1 2 3
Anatomy of <origam-svg-icon> — 3 internal parts. The root wrapper carries size and colour classes; the inner <svg> is aria-hidden and renders one or more <path> elements.
1.origam-icon.origam-icon--svg
Root wrapper element (default <div>). Carries origam-icon--svg, optional size class (origam-icon--size-{size}), and inline size style for numeric sizes.
2.origam-icon__svg
<svg> element. Always aria-hidden="true" and focusable="false". viewBox is fixed at 24x24. fill: currentColor — inherits colour from the parent.
3path
One or more <path> elements. For multi-path arrays the second tuple value sets fill-opacity.

API

Props

Toutes les props acceptées par ce composant, avec leur type, valeur par défaut et description.

icon
TIcon
SVG path data. Pass a single path string for a single-path icon, or an array of [path, fillOpacity?] tuples for multi-path icons.
color
Icon fill colour. Accepts a semantic intent token or a CSS colour. Defaults to currentColor so the icon inherits the parent text colour.
bgColor
Background colour of the root wrapper element.
id
string
class
string | Array<string> | object
disabled
boolean
false
Applies the disabled token colour and reduces opacity.
style
string | Array<string> | object | StyleValue
tag
string
'div'
HTML element rendered as the wrapper around the SVG. Defaults to div.
Icon size. Accepts a named size token (x-small, small, default, large, x-large) which applies a size class, or a number converted to px as an inline style.
padding
boolean | number | string
paddingTop
boolean | number | string
paddingLeft
boolean | number | string
paddingBottom
boolean | number | string
paddingRight
boolean | number | string
paddingBlock
boolean | number | string
paddingInline
boolean | number | string
paddingInlineStart
boolean | number | string
paddingInlineEnd
boolean | number | string
paddingBlockStart
boolean | number | string
paddingBlockEnd
boolean | number | string
margin
boolean | number | string
marginTop
boolean | number | string
marginLeft
boolean | number | string
marginBottom
boolean | number | string
marginRight
boolean | number | string
marginBlock
boolean | number | string
marginInline
boolean | number | string
marginInlineStart
boolean | number | string
marginInlineEnd
boolean | number | string
marginBlockStart
boolean | number | string
marginBlockEnd
boolean | number | string
border
boolean | number | string | TDirectionBoth | Array<TDirectionBoth>
false
Applies a border to the root wrapper.
borderTop
boolean | number | string
borderLeft
boolean | number | string
borderBottom
boolean | number | string
borderRight
boolean | number | string
borderBlock
boolean | number | string
borderInline
boolean | number | string
borderInlineStart
boolean | number | string
borderInlineEnd
boolean | number | string
borderBlockStart
boolean | number | string
borderBlockEnd
boolean | number | string
borderColor
string
borderStyle
string
borderTopColor
TColor
borderRightColor
TColor
borderBottomColor
TColor
borderLeftColor
TColor
borderInlineStartColor
TColor
borderInlineEndColor
TColor
borderBlockStartColor
TColor
borderBlockEndColor
TColor
height
number | string
maxHeight
number | string
maxWidth
number | string
minHeight
number | string
minWidth
number | string
width
number | string
Border-radius token applied to the root wrapper.
roundedTopRight
boolean | number | string
roundedTopLeft
boolean | number | string
roundedBottomLeft
boolean | number | string
roundedBottomRight
boolean | number | string
roundedStartStart
boolean | number | string
roundedStartEnd
boolean | number | string
roundedEndStart
boolean | number | string
roundedEndEnd
boolean | number | string

API

Membres exposés

Propriétés et méthodes accessibles via ref template (defineExpose). Utilisés pour le contrôle programmatique.

<T extends object>(props: T, exclude?: string[]) => Partial<T>
Utility to forward a filtered subset of props to a child component.
Ref<string>
Reactive CSS string generated by useStyle from the computed icon styles.
string
Unique style-sheet ID for this instance.
() => void
Injects the computed style sheet into the document. Called automatically on mount.
() => void
Removes the injected style sheet. Called automatically on unmount.
Ref<boolean>
True once the style sheet has been injected into the DOM.

Personnalisation

Variables CSS

Propriétés CSS personnalisées exposées par ce composant. Surchargez-les pour personnaliser sans perdre la compatibilité avec le thème.

Icon fill colour. Defaults to currentColor so the icon inherits the parent text colour.
Icon size when size="x-small".
Icon size when size="small".
Icon size when size="default".
Icon size when size="large".
Icon size when size="x-large".

Inclusion

Accessibilité

Rôles ARIA, navigation clavier et gestion du focus. Sourcé depuis le template réel du composant.

Notes

  • The inner <svg> element always carries aria-hidden="true" and focusable="false". The icon is decorative — the parent element must provide a meaningful aria-label when the icon conveys information.
  • SVG paths inherit fill: currentColor. Ensure the surrounding text colour meets WCAG AA contrast ratio against the background.

Fondation

Design tokens

Extrait des tokens de ce composant — les variables --origam-<composant>---<propriété>, déclarées dans sa feuille de tokens tenue à la main, sans étape de build.

Source
color
currentColor
Default fill colour — inherits from the parent text colour.
dimension
var(--origam-font__size---md)
Size for the default size variant.
dimension
var(--origam-font__size---lg)
Size for the large variant.
duration
var(--origam-motion__duration---fast)
Transition duration for colour changes.

Interactif

Playground

Modifiez les props en direct et observez le composant se mettre à jour. Le snippet de code généré suit vos changements.

Rendu de l’aperçu en cours…

Usage

Exemples

Extraits de code prêts à coller dans vos templates.

Basic SVG path icon

vue

Multi-path icon

vue

Écosystème

Famille

Composants du même dossier qui partagent les conventions et se composent souvent ensemble.