Lens Blocks is a shadcn/ui Registry of useful social React components for Lens Social Protocol using the official Lens React SDK, wagmi, and shadcn/ui.
The registry includes essentials like a wallet-aware login button (using viem/wagmi), a full-featured post component (with markdown, mentions, reactions, collects, tips), a follow button, and a WYSIWYG rich text editor.
Each block deeply integrates with the Lens React SDK and handles wallet connection, signing, authentication, session lifecycle, optimistic updates, and state management out of the box.
Much like shadcn/ui itself, Lens Blocks is a registry of React components that can be installed individually using the shadcn/ui CLI.
The registry is part of the official shadcn directory, so component installations can use the @lens-blocks namespace without any additional configuration. Eg:
pnpm dlx shadcn@latest add @lens-blocks/loginAll components hook deeply into the Lens React SDK and use wagmi for wallet connection and signing. With just a single command, multiple components and libraries are added directly to your project. Everything including wallet connection, Lens API authentication, account switching, and more is handled for you.
You can add a full Lens login flow to your app in minutes:
import { LensLogin } from "@/components/account/lens-login";
import { useSessionClient } from "@lens-protocol/react";
import { useWalletClient } from "wagmi";
export function Login() {
const session = useSessionClient();
const wallet = useWalletClient();
return <LensLogin session={session} wallet={wallet} />;
}View the Login Block page on the website for more detailed usage instructions.
View the Lens Blocks Website for more detailed installation instructions and to see all available blocks, components, hooks, and libraries.
Lens Blocks is currently in beta and subject to change. It's not recommended to use the components in production yet.
Not yet open to contributions during initial development. Feedback and suggestions are welcome!