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 🙏

© 2026 – Pkg Stats / Ryan Hefner

@framer-framer/react

v3.4.0

Published

React component for framer-framer - embed any URL with <Embed url="..." />

Downloads

315

Readme

@framer-framer/react

React component for framer-framer — embed any URL with <Embed url="..." />.

Installation

npm install @framer-framer/react framer-framer react react-dom

Quick Start

import { Embed } from '@framer-framer/react';

function App() {
  return <Embed url="https://www.youtube.com/watch?v=dQw4w9WgXcQ" />;
}

API

<Embed /> Component

| Prop | Type | Description | |---|---|---| | url | string | (required) URL to embed | | maxWidth | number | Max embed width in pixels | | maxHeight | number | Max embed height in pixels | | embedOptions | EmbedOptions | Options passed to embed() | | initialData | EmbedResult | Pre-fetched embed data (skips client-side fetch) | | onLoad | (result: EmbedResult) => void | Called on successful resolution | | onError | (error: Error) => void | Called on resolution failure | | loadingFallback | ReactNode | Custom loading component | | errorFallback | ReactNode \| (error: Error) => ReactNode | Custom error component | | className | string | CSS class for the container | | style | CSSProperties | Inline styles for the container | | ref | Ref<HTMLDivElement> | Forwarded ref to container div |

useEmbed() Hook

import { useEmbed } from '@framer-framer/react';

function MyEmbed({ url }: { url: string }) {
  const { status, data, error } = useEmbed(url, { maxWidth: 600 });

  if (status === 'loading') return <p>Loading...</p>;
  if (status === 'error') return <p>Error: {error.message}</p>;
  return <div dangerouslySetInnerHTML={{ __html: data.html }} />;
}

<Skeleton /> and <ErrorState />

Built-in UI components used by <Embed /> internally. You can import them for custom compositions:

import { Skeleton, ErrorState } from '@framer-framer/react';

SSR / React Server Components

Server Component (EmbedServer)

Use EmbedServer from the /server export to fetch embed data entirely on the server — no client-side JavaScript required:

// app/page.tsx (Next.js App Router - Server Component)
import { EmbedServer } from '@framer-framer/react/server';

export default async function Page() {
  return <EmbedServer url="https://www.youtube.com/watch?v=dQw4w9WgXcQ" />;
}

EmbedServer is an async component that calls embed() on the server and renders the resulting HTML directly. It does not include "use client" and ships zero client-side JavaScript.

| Prop | Type | Description | |---|---|---| | url | string | (required) URL to embed | | maxWidth | number | Max embed width in pixels | | maxHeight | number | Max embed height in pixels | | embedOptions | EmbedOptions | Options passed to embed() | | errorFallback | ReactNode \| (error: Error) => ReactNode | Custom error component | | className | string | CSS class for the container | | style | CSSProperties | Inline styles for the container | | theme | 'light' \| 'dark' \| 'auto' | Theme mode (default: 'auto') |

Server-fetched data with Client Component (initialData)

Fetch data on the server and pass it to the client <Embed /> via initialData to avoid a loading flash while retaining client-side interactivity (callbacks, ref, etc.):

// app/page.tsx (Server Component)
import { embed } from 'framer-framer';
import { EmbedSection } from './EmbedSection';

export default async function Page() {
  const data = await embed('https://www.youtube.com/watch?v=dQw4w9WgXcQ');
  return <EmbedSection url="https://www.youtube.com/watch?v=dQw4w9WgXcQ" initialData={data} />;
}
// app/EmbedSection.tsx (Client Component)
'use client';
import { Embed } from '@framer-framer/react';
import type { EmbedResult } from 'framer-framer';

export function EmbedSection({ url, initialData }: { url: string; initialData: EmbedResult }) {
  return <Embed url={url} initialData={initialData} onLoad={(r) => console.log(r.title)} />;
}

Client-only (default)

The main export uses the "use client" directive. During SSR it renders the skeleton placeholder; the embed resolves client-side after hydration via useEffect.

Examples

Custom Loading & Error

<Embed
  url="https://x.com/jack/status/20"
  loadingFallback={<MySpinner />}
  errorFallback={(err) => <p>Could not load: {err.message}</p>}
/>

With Callbacks

<Embed
  url="https://vimeo.com/1084537"
  onLoad={(result) => console.log('Loaded:', result.title)}
  onError={(err) => console.error('Failed:', err)}
/>

Next.js App Router

// app/page.tsx — fully server-rendered, zero client JS
import { EmbedServer } from '@framer-framer/react/server';

export default async function Page() {
  return <EmbedServer url="https://www.youtube.com/watch?v=dQw4w9WgXcQ" maxWidth={800} />;
}

License

MIT