Skip to content

Instantly share code, notes, and snippets.

@vollyimnetz
Last active July 7, 2025 09:50
Show Gist options
  • Select an option

  • Save vollyimnetz/f2ad7c0f04c584eb1fc3ae5f4918dc62 to your computer and use it in GitHub Desktop.

Select an option

Save vollyimnetz/f2ad7c0f04c584eb1fc3ae5f4918dc62 to your computer and use it in GitHub Desktop.
Simple SVG Icon in Vue
/** version: 1.0.0 **/
<template>
<i class="TmSimpleSvgIcon" aria-hidden="true"><svg viewBox="0 0 24 24"><path :d="path"></path></svg></i>
</template>
<script>
export default {
name: 'TmSimpleSvgIcon',
props: {
path: { type: String, required: true },
},
};
</script>
<style>
.TmSimpleSvgIcon {
line-height: 1;
width: 1em;
height: 1em;
flex-shrink: 0;
letter-spacing: normal;
text-transform: none;
white-space: nowrap;
word-wrap: normal;
direction: ltr;
text-align: center;
position: relative;
box-sizing: content-box;
fill: currentColor;
user-select: none;
cursor: inherit;
font-size: inherit;
display: inline-flex;
align-items: center;
justify-content: center;
vertical-align: text-top;
}
.TmSimpleSvgIconn>svg {
width: 100%;
height: 100%;
}
</style>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment