Skip to content

Instantly share code, notes, and snippets.

@vikramsoni2
Created January 31, 2024 00:14
Show Gist options
  • Save vikramsoni2/4c3f0d0dfdcea053f99d8ff091440c50 to your computer and use it in GitHub Desktop.
Save vikramsoni2/4c3f0d0dfdcea053f99d8ff091440c50 to your computer and use it in GitHub Desktop.
circular progress bar in vuejs
<script setup>
const props = defineProps({
progress: {
type: Number,
default: 0,
},
})
</script>
<template>
<svg viewBox="-6.25 -6.25 62.5 62.5" version="1.1" xmlns="http://www.w3.org/2000/svg" style="transform:rotate(-90deg)">
<circle r="15.92" cx="25" cy="25" fill="transparent" stroke="#88888850" stroke-width="5" stroke-dasharray="100px" stroke-dashoffset="0"></circle>
<circle r="15.92" cx="25" cy="25" stroke="currentcolor" stroke-width="5" stroke-linecap="butt" :stroke-dashoffset="100 - props.progress +'px'" fill="transparent" stroke-dasharray="100px"></circle>
</svg>
</template>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment