npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

bluesky-embed-react

v0.0.2

Published

React component to embed bluesky posts, profiles and feeds

Readme

Bluesky Embed React

npm Storybook CI Coverage License

Lightweight configurable React component for embedding posts, profiles and feeds from Bluesky.

Bluesky Embed React is an independent project, not affiliated with Bluesky.

Demo and Examples

https://etherington.xyz/bluesky-embed-react

Install

npm install bluesky-embed-react

or

yarn add bluesky-embed-react

Basic Usage

Importing

import {
	BlueskyPost,
	BlueskyProfilePosts,
	BlueskyConfigProvider,
} from "bluesky-embed-react";

Embed a post

<BlueskyPost userHandle="bsky.app" postId="3l6oveex3ii2l" />
  • userHandle The username or DID of the user who created the post
  • postId The ID of the post to embed

For instance, in the post https://bsky.app/profile/bsky.app/post/3l3t5pvpm222b the userHandle is "bsky.app" and the postId is "3l3t5pvpm222b".

Embed a users profile feed

<BlueskyProfilePosts userHandle="bsky.app" />
  • userHandle The username or DID of the user to embed
  • pageSize The number of posts to display (and fetch if using infinite loading)
  • infiniteLoad Enable inifite loading when scrolling to the end of the list

Configuration

Advanced configuration can be done by wrapping the components in a BlueskyConfigProvider:

<BlueskyConfigProvider hideAvatars>
	<BlueskyPost userHandle="bsky.app" postId="3l6oveex3ii2l" />
</BlueskyConfigProvider>

The props are of type BlueskyConfig which has the following properties:

  • app The base URL to use for outward links (default https://bsky.app)
  • service The base URL for the API (default https://public.api.bsky.app)
  • openLinksInNewTab Open links in place or in a new tab (default false)
  • avatarSize The size of user avatars in pixels (default 42)
  • hideAvatars Whether or not to hide user avatars (default false)
  • hideEmbeds Whether or not to hide embedded media and links (default false)
  • textPrimaryColor CSS color string for primary text (default #f1f3f5)
  • textSecondaryColor CSS color string for secondary text (default #aebbc9)
  • backgroundColor CSS color string for post backgrounds (default #161e27)
  • borderColor CSS color string for borders (default #2e4052)
  • loadingShimmer CSS color string for the loading shimmer effect (default linear-gradient(100deg, #aaa 40%, #bdbdbd 50%, #aaa 60%))
  • fontFamily CSS font stack to apply to all posts (default InterVariable, Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji")
  • fontSize CSS font size for main text (default 15px)
  • embedFontSize CSS font size for embedded media descriptions (default 14px)
  • fontWeight CSS font weight for main text (default 400)
  • titleFontWeight CSS font weight for title text (default 600)
  • lineHeight CSS line height for all text (default 140%)
  • grid Grid size in pixels used for calculating all margins and padding (default 8px)
  • borderRadius CSS border radius applied to posts and loaders (default 6px)
  • width CSS width applied to posts (default 600px)
  • formatShortDate Function to format dates into a short format
  • formatLongDate Function to format dates into a long format

License

MIT © oetherington. See the included COPYING file for details.