Skip to content

Class: SvgIcon

A lightweight SVG icon component that renders Material Design Icons or custom SVG paths. Automatically handles responsive sizing with special logic for iOS/Safari browsers.

Example

typescript
// Render with default size
<SvgIcon d={mdiClose} />

// Render with custom dimensions
<SvgIcon d={mdiClose} width={32} height={32} />

Remarks

  • Uses currentColor for fill, allowing CSS color inheritance
  • Automatically applies 100% width/height on iOS devices for better rendering
  • Accepts both numeric and string values for width/height

Properties

PropertyModifierTypeDescription
$publicComponentInternalInstance-
$attrspublicData-
$datapublic{ }-
$elpublicany-
$emitpublic(event: string, ...args: any[]) => void-
$forceUpdatepublic() => void-
$hostpublicElement | null-
$nextTickpublic{ (): Promise<void>; <T, R> (this: T, fn: (this: T) => R | Promise<R>): Promise<R>; }-
$optionspublicComponentOptionsBase<ToResolvedProps<ExtractPropTypes<{ d: { required: true; type: PropType<string>; }; height: { default: undefined; type: PropType<string | number | undefined>; }; width: { default: undefined; type: PropType<string | number | undefined>; }; }>, { }>, () => VNode<RendererNode, RendererElement, { [key: string]: any; }>, { }, { }, { }, ComponentOptionsMixin, ComponentOptionsMixin, { }, string, { height: string | number | undefined; width: string | number | undefined; }, { }, string, { }, GlobalComponents, GlobalDirectives, string, ComponentProvideOptions> & MergedComponentOptionsOverride-
$parentpublic| ComponentPublicInstance<{ }, { }, { }, { }, { }, { }, { }, { }, false, ComponentOptionsBase<any, any, any, any, any, any, any, any, any, { }, { }, string, { }, { }, { }, string, ComponentProvideOptions>, { }, { }, "", { }, any> | null-
$propspublicPartial<{ height: string | number | undefined; width: string | number | undefined; }> & Omit<{ d: string; height?: string | number; width?: string | number; } & VNodeProps & AllowedComponentProps & ComponentCustomProps, DefaultKeys<{ d: { required: true; type: PropType<string>; }; height: { default: undefined; type: PropType<string | number | undefined>; }; width: { default: undefined; type: PropType<string | number | undefined>; }; }>>-
$refspublicData-
$rootpublic| ComponentPublicInstance<{ }, { }, { }, { }, { }, { }, { }, { }, false, ComponentOptionsBase<any, any, any, any, any, any, any, any, any, { }, { }, string, { }, { }, { }, string, ComponentProvideOptions>, { }, { }, "", { }, any> | null-
$slotspublicUnwrapSlotsType<S>-
$vuetifypublicVuetify-
dreadonlystring-
heightreadonlystring | number | undefined-
widthreadonlystring | number | undefined-
__defaults?static{ height: string | number | undefined; width: string | number | undefined; }-
__defaults.heightpublicstring | number | undefined-
__defaults.widthpublicstring | number | undefined-
__differentiator?staticundefined#3468 type-only, used to assist Mixin's type inference, TypeScript will try to simplify the inferred Mixin type, with the __differentiator, TypeScript won't be able to combine different mixins, because the __differentiator will be different
__file?staticstringThis one should be exposed so that devtools can make use of it
__isBuiltIn?staticbooleanCompat build only, for bailing out of certain compatibility behavior
__isFragment?staticundefined-
__isSuspense?staticundefined-
__isTeleport?staticundefined-
__name?staticstringname inferred from filename
call?static(this: unknown, ...args: unknown[]) => never-
class?staticunknown-
compatConfig?staticCompatConfig-
compilerOptions?staticRuntimeCompilerOptions-
components?staticGlobalComponents & Record<string, Component<any, any, any, ComputedOptions, MethodOptions, { }, any>>-
computed?static{ }-
data?static(this: CreateComponentPublicInstanceWithMixins<ToResolvedProps<ExtractPropTypes<{ d: { required: true; type: PropType<string>; }; height: { default: undefined; type: PropType<string | number | undefined>; }; width: { default: undefined; type: PropType<string | number | undefined>; }; }>, { }>, { }, { }, { }, MethodOptions, ComponentOptionsMixin, ComponentOptionsMixin>, vm: CreateComponentPublicInstanceWithMixins<ToResolvedProps<ExtractPropTypes<{ d: { required: true; type: PropType<string>; }; height: { default: undefined; type: PropType<string | number | undefined>; }; width: { default: undefined; type: PropType<string | number | undefined>; }; }>, { }>, { }, { }, { }, MethodOptions, ComponentOptionsMixin, ComponentOptionsMixin>) => { }-
delimiters?static[string, string]runtime compile only Deprecated use compilerOptions.delimiters instead.
directives?staticGlobalDirectives & Record<string, Directive<any, any, string, any>>-
emits?static(string[] | {}) & ThisType<void>-
errorCaptured?staticErrorCapturedHook<unknown>-
expose?staticstring[]-
extends?staticComponentOptionsMixin-
filters?staticRecord<string, Function>-
inheritAttrs?staticboolean-
inject?static| { } | string[]-
key?staticPropertyKey-
methods?static{ }-
mixins?staticComponentOptionsMixin[]-
name?staticstring-
onVnodeBeforeMount?staticVNodeMountHook | VNodeMountHook[]-
onVnodeBeforeUnmount?staticVNodeMountHook | VNodeMountHook[]-
onVnodeBeforeUpdate?staticVNodeUpdateHook | VNodeUpdateHook[]-
onVnodeMounted?staticVNodeMountHook | VNodeMountHook[]-
onVnodeUnmounted?staticVNodeMountHook | VNodeMountHook[]-
onVnodeUpdated?staticVNodeUpdateHook | VNodeUpdateHook[]-
provide?staticComponentProvideOptions-
ref?staticVNodeRef-
ref_for?staticboolean-
ref_key?staticstring-
render?staticFunction-
renderTracked?staticDebuggerHook-
renderTriggered?staticDebuggerHook-
setup?static(this: void, props: LooseRequired<Props & Prettify<UnwrapMixinsType<IntersectionMixin<Mixin> & IntersectionMixin<Extends>, "P">>>, ctx: { attrs: Data; emit: (event: string, ...args: any[]) => void; expose: <Exposed>(exposed?: Exposed) => void; slots: UnwrapSlotsType<S>; }) => | void | RenderFunction | () => VNode<RendererNode, RendererElement, { [key: string]: any; }> | Promise<() => VNode<RendererNode, RendererElement, { [key: string]: any; }>>-
slots?static{ }-
style?staticunknown-
template?staticstring | object-
watch?staticComponentWatchOptions-

Methods

$watch()

ts
$watch<T>(
   source: T,
   cb: T extends (...args: any) => R ? (...args: [R, R, OnCleanup]) => any : (...args: [any, any, OnCleanup]) => any,
   options?: WatchOptions<boolean>): WatchStopHandle;

Type Parameters

Type Parameter
T extends string | (...args: any) => any

Parameters

ParameterType
sourceT
cbT extends (...args: any) => R ? (...args: [R, R, OnCleanup]) => any : (...args: [any, any, OnCleanup]) => any
options?WatchOptions<boolean>

Returns

WatchStopHandle


activated()?

ts
static optional activated(): any;

Returns

any


beforeCreate()?

ts
static optional beforeCreate(): any;

Returns

any


beforeDestroy()?

ts
static optional beforeDestroy(): any;

Returns

any

Deprecated

use beforeUnmount instead


beforeMount()?

ts
static optional beforeMount(): any;

Returns

any


beforeUnmount()?

ts
static optional beforeUnmount(): any;

Returns

any


beforeUpdate()?

ts
static optional beforeUpdate(): any;

Returns

any


created()?

ts
static optional created(): any;

Returns

any


deactivated()?

ts
static optional deactivated(): any;

Returns

any


destroyed()?

ts
static optional destroyed(): any;

Returns

any

Deprecated

use unmounted instead


mounted()?

ts
static optional mounted(): any;

Returns

any


serverPrefetch()?

ts
static optional serverPrefetch(): void | Promise<any>;

Returns

void | Promise<any>


unmounted()?

ts
static optional unmounted(): any;

Returns

any


updated()?

ts
static optional updated(): any;

Returns

any