SvgIcon
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…
defaultRendu de l’aperçu en cours…
largeStructure
Anatomie
Décomposition visuelle de la structure interne du composant avec les appels de classes BEM.
<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>). Carriesorigam-icon--svg, optional size class (origam-icon--size-{size}), and inline size style for numeric sizes. - 2.origam-icon__svg
<svg>element. Alwaysaria-hidden="true"andfocusable="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 setsfill-opacity.
API
Props
Toutes les props acceptées par ce composant, avec leur type, valeur par défaut et description.
- iconTIcon
- 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.
- idstring
- classstring | Array<string> | object
- disabledbooleanfalse
- Applies the disabled token colour and reduces opacity.
- stylestring | Array<string> | object | StyleValue
- tagstring'div'
- HTML element rendered as the wrapper around the SVG. Defaults to div.
- size
- 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.
- paddingboolean | number | string
- paddingTopboolean | number | string
- paddingLeftboolean | number | string
- paddingBottomboolean | number | string
- paddingRightboolean | number | string
- paddingBlockboolean | number | string
- paddingInlineboolean | number | string
- paddingInlineStartboolean | number | string
- paddingInlineEndboolean | number | string
- paddingBlockStartboolean | number | string
- paddingBlockEndboolean | number | string
- marginboolean | number | string
- marginTopboolean | number | string
- marginLeftboolean | number | string
- marginBottomboolean | number | string
- marginRightboolean | number | string
- marginBlockboolean | number | string
- marginInlineboolean | number | string
- marginInlineStartboolean | number | string
- marginInlineEndboolean | number | string
- marginBlockStartboolean | number | string
- marginBlockEndboolean | number | string
- borderboolean | number | string | TDirectionBoth | Array<TDirectionBoth>false
- Applies a border to the root wrapper.
- borderTopboolean | number | string
- borderLeftboolean | number | string
- borderBottomboolean | number | string
- borderRightboolean | number | string
- borderBlockboolean | number | string
- borderInlineboolean | number | string
- borderInlineStartboolean | number | string
- borderInlineEndboolean | number | string
- borderBlockStartboolean | number | string
- borderBlockEndboolean | number | string
- borderColorstring
- borderStylestring
- borderTopColorTColor
- borderRightColorTColor
- borderBottomColorTColor
- borderLeftColorTColor
- borderInlineStartColorTColor
- borderInlineEndColorTColor
- borderBlockStartColorTColor
- borderBlockEndColorTColor
- heightnumber | string
- maxHeightnumber | string
- maxWidthnumber | string
- minHeightnumber | string
- minWidthnumber | string
- widthnumber | string
- Border-radius token applied to the root wrapper.
- roundedTopRightboolean | number | string
- roundedTopLeftboolean | number | string
- roundedBottomLeftboolean | number | string
- roundedBottomRightboolean | number | string
- roundedStartStartboolean | number | string
- roundedStartEndboolean | number | string
- roundedEndStartboolean | number | string
- roundedEndEndboolean | 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.
- colorcurrentColor
- Default fill colour — inherits from the parent text colour.
- dimensionvar(--origam-font__size---md)
- Size for the default size variant.
- dimensionvar(--origam-font__size---lg)
- Size for the large variant.
- durationvar(--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
Multi-path icon
Écosystème
Famille
Composants du même dossier qui partagent les conventions et se composent souvent ensemble.