Component library for giscus, a comment system powered by GitHub Discussions.
The giscus-component is a wrapper component for giscus, a comments system powered by GitHub Discussions. It is currently available for React, Vue, Svelte, Solid, and as a WebComponent. This component allows users to easily integrate the giscus comments system into their web applications.
Example for React:
import GiscusComponent from '@giscus/react';
// Use the component in your code
<GiscusComponent repo="owner/repo" issue-id="123" />
Example:
import 'giscus';
// Use it in your HTML
<giscus-repo repo="owner/repo" issue-id="123"></giscus-repo>
You can style the <iframe> in your CSS by selecting the web component or the iframe part specifically. For example:
giscus-repo {
background-color: #f4f4f4;
border: none;
}
giscus-repo iframe {
border-radius: 5px;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}
You can also make the widget scrollable by creating a parent container with a limited height and overflow: scroll, for example:
.giscus-container {
height: 400px;
overflow: scroll;
}
Note that these styles only apply to the <iframe> element and not its contents. To style the contents, a custom theme needs to be used.
The giscus-component is a versatile wrapper component for integrating the giscus comments system into web applications. It supports multiple frameworks and provides easy installation and customization options. Developers can easily add a commenting feature to their websites using this component.
React is a widely used JavaScript library for building user interfaces and single-page applications. It follows a component-based architecture and uses a virtual DOM to efficiently update and render UI components
SolidJS is a declarative JavaScript library for building user interfaces, offering a reactive programming model for efficient updates. It stands out for its reactivity system that minimizes unnecessary re-renders and its small bundle size, making it a performant choice for developing lightweight and reactive web applications.
Svelte is a modern front-end framework that compiles your code at build time, resulting in smaller and faster applications. It uses a reactive approach to update the DOM, allowing for high performance and a smoother user experience.
Vue.js is a lightweight and flexible JavaScript framework that allows developers to easily build dynamic and reactive user interfaces. Its intuitive syntax, modular architecture, and focus on performance make it a popular choice for modern web development.
Web components provide a way to create reusable, encapsulated UI components using standard web technologies such as HTML, CSS, and JavaScript. They allow developers to create complex UI components that can be easily shared across multiple projects and frameworks. Web components are built using four main specifications: Custom Elements, Shadow DOM, HTML Templates, and ES Modules.