Vue component for the Website Carbon badge.
via npm
npm install vue-carbonbadge
or via yarn
yarn add vue-carbonbadge
<template>
<CarbonBadge />
</template>
<script setup>
import CarbonBadge from "vue-carbonbadge";
</script>
In Nuxt, you need to wrap the component in a <ClientOnly>
component to prevent the badge from being rendered on the server:
<template>
<ClientOnly>
<CarbonBadge/>
</ClientOnly>
</template>
<script setup>
import CarbonBadge from "vue-carbonbadge"
</script>
Toggling dark mode
<CarbonBadge :dark="true" />
If the dark
property is not specified, dark mode is detected as per user system preferences.