···11# bsky_comments_widget
2233+a web component that shows the replies to a linked bsky post as comments.
44+35[](https://hex.pm/packages/bsky_comments_widget)
46[](https://hexdocs.pm/bsky_comments_widget/)
5788+## usage
99+1010+### from a CDN
1111+1212+include this element at the end of your `<head>`:
1313+```html
1414+<script src="https://cdn.jsdelivr.net/npm/bsky_comments_widget@1.0.0/bsky_comments_widget.js" defer></script>
1515+```
1616+1717+then you can use the web component wherever you want. for example:
1818+```html
1919+<style>
2020+ .comments-container {
2121+ padding: 8rem;
2222+ padding-top: 2rem;
2323+ width: 100%;
2424+ max-width: 56rem;
2525+ margin-left: auto;
2626+ margin-right: auto;
2727+ }
2828+</style>
2929+3030+<body>
3131+ <div class="comments-container">
3232+ comments here
3333+ <bsky-comments post_url="https://bsky.app/profile/mrgan.com/post/3michx3lqa22y" />
3434+ </div>
3535+</body>
3636+```
3737+3838+you can download the js file from the cdn and serve it yourself, too.
3939+4040+### from NPM
4141+4242+```sh
4343+npm install bsky_comments_widget
4444+```
4545+4646+then:
4747+```js
4848+import { register } from "bsky_comments_widget"
4949+5050+register()
5151+```
5252+5353+### from Gleam (`vite-gleam` needed)
5454+655```sh
756gleam add bsky_comments_widget@1
857```
5858+959```gleam
1010-import bsky_comments_widget
6060+import bsky_comments_widget/widget
11611212-pub fn main() -> Nil {
1313- // TODO: An example of the project in use
6262+pub fn main() {
6363+ widget.register()
6464+ // then the web component should work in any HTML template you use
1465}
1566```
16671717-Further documentation can be found at <https://hexdocs.pm/bsky_comments_widget>.
6868+## styling
18691919-## Development
7070+the component will load any classes from its parent document. this means that you can override the class styles with your own.
7171+7272+## development
20732174```sh
2222-gleam run # Run the project
2323-gleam test # Run the tests
7575+pnpm install # install the required dependencies
7676+pnpm run dev # run the project through vite
2477```