Type-safe Vue component for giscus 💎
giscus is a lightweight comments widget built on GitHub issues, for blog comments, wiki pages and more.
- 📚 Pure TypeScript and TSX with type definitions
- 🌎 Multiple modules, providing
ES modules
andCommonJS
Follow the instructions on the main website and use the
data attributes of the shown <script>
tag as the props to the Giscus
component.
Local import of the component is recommended.
<template>
<Giscus
repo="..."
repoId="..."
category="..."
categoryId="..."
mapping="..."
term="..."
reactionsEnabled="..."
emitMetadata="..."
theme="..."
/>
</template>
<script setup lang="ts">
import { Giscus } from '@giscus/vue';
</script>
You can also register a component globally, although not recommended.
import { createApp } from 'vue'
import App from './App.vue'
import { plugin } from '@giscus/vue'
createApp(App).use(plugin).mount('#app')
<template>
<Giscus
repo="..."
repoId="..."
category="..."
categoryId="..."
mapping="..."
term="..."
reactionsEnabled="..."
theme="..."
/>
</template>
npm i @giscus/vue
# or
yarn add @giscus/vue
The module that bundles the dependencies is obtained from skypack.
Import it like this:
import { Giscus } from 'https://cdn.skypack.dev/@giscus/vue'
Contributions, issues and feature requests are welcome! Feel free to check out the repository.
Give a ⭐️ if this project helped you!
Copyright © 2021-present TomokiMiyauci, forked by laymonage for giscus.
Released under the MIT license.