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

@memos-embed/react

v0.4.4

Published

React component wrapper for embedding Memos memo cards.

Readme

@memos-embed/react

React wrapper for Memos embed cards.

Install

pnpm add @memos-embed/react

Usage

import { MemoEmbed } from '@memos-embed/react'

export function App() {
  return (
    <MemoEmbed
      baseUrl="https://demo.usememos.com"
      memoId="1"
      theme="glass"
      density="comfortable"
      linkTarget="_blank"
      showTags
      showAttachments
      showReactions
      showMeta
      onLoad={(memo) => console.log('loaded memo', memo.name)}
      onError={(error) => console.error(error)}
    />
  )
}

baseUrl can be your Memos instance root, /api, or /api/v1. The shared core normalizes all three forms before requesting memo data.

Roundup usage

import { MemoEmbedList } from '@memos-embed/react'

<MemoEmbedList
  baseUrl="https://demo.usememos.com/api/v1"
  memoIds={["1", "2", "3"]}
  layout="stack"
  gap="20px"
  theme="paper"
/>

Shared client usage

import { createMemoClient } from 'memos-embed'
import { MemoClientProvider, MemoEmbed, MemoEmbedList } from '@memos-embed/react'

const client = createMemoClient()

<MemoClientProvider client={client}>
  <MemoEmbed baseUrl="https://demo.usememos.com/api/v1" memoId="1" />
  <MemoEmbedList baseUrl="https://demo.usememos.com/api/v1" memoIds={["2", "3"]} />
</MemoClientProvider>

Use a shared client when multiple embeds on one page should reuse memo and creator fetches instead of opening duplicate requests.

Shared client with server-prefetched memo data

import { createMemoClient, fetchMemo, fetchMemos } from 'memos-embed'
import { MemoClientProvider, MemoEmbed, MemoEmbedList } from '@memos-embed/react'

const client = createMemoClient()

const [heroMemo, roundupMemos] = await Promise.all([
  fetchMemo({
    baseUrl: 'https://demo.usememos.com/api/v1',
    memoId: '1',
  }),
  fetchMemos({
    baseUrl: 'https://demo.usememos.com/api/v1',
    memoIds: ['2', '3'],
  }),
])

<MemoClientProvider client={client}>
  <MemoEmbed
    baseUrl="https://demo.usememos.com/api/v1"
    memo={heroMemo}
  />
  <MemoEmbedList
    baseUrl="https://demo.usememos.com/api/v1"
    memos={roundupMemos}
  />
</MemoClientProvider>

Passing memo or memos while a MemoClientProvider is active primes the shared client cache, so later embeds for the same memo ids can reuse that data.

When you pass pre-fetched memo or memos, the component now renders full embed markup during SSR/SSG instead of waiting for client-side hydration.

Pre-fetched usage

import { fetchMemo } from 'memos-embed'
import { MemoEmbed } from '@memos-embed/react'

const memo = await fetchMemo({
  baseUrl: 'https://demo.usememos.com/api/v1',
  memoId: '1',
})

<MemoEmbed memo={memo} className="my-8" />

This path is ideal for MDX, Next.js, Astro, and other SSR setups because the rendered memo HTML is included in the initial response.

Styling with your blog theme

import { extendTheme } from 'memos-embed'

const blogTheme = extendTheme('minimal', {
  fontFamily: 'inherit',
  radius: 'var(--radius)',
  tokens: {
    background: 'var(--card)',
    foreground: 'var(--card-foreground)',
    mutedForeground: 'var(--muted-foreground)',
    border: 'var(--border)',
    accent: 'var(--primary)',
    accentForeground: 'var(--primary-foreground)',
    codeBackground: 'var(--muted)',
  },
})

<MemoEmbed memo={memo} theme={blogTheme} />

If you want to bring all styles yourself, pass includeStyles={false} and render your own CSS around the generated markup.

Props and notes

  • memoId: target memo id
  • baseUrl: Memos API base URL, for example https://demo.usememos.com/api/v1
  • theme: theme preset or custom theme input
  • density: compact or comfortable
  • locale: locale passed to date formatting
  • showTags: show memo tags
  • showAttachments: show attachments
  • showReactions: show reactions
  • showMeta: show creator and timestamp metadata
  • linkTarget: keeps markdown and attachment links consistent with iframe and Web Component embeds
  • onLoad: called after memo data is loaded
  • onError: called when loading fails
  • Pass memo to render already-fetched data and avoid a client-side request waterfall
  • Use MemoEmbedList when you want multiple memo cards with one shared style block in React
  • Use MemoClientProvider with createMemoClient() when many embeds on one page should share request and cache state
  • fetcher and includeCreator are forwarded to the shared fetchMemo() and fetchMemos() helpers when components fetch their own data
  • includeStyles={false} disables the built-in <style> block for bring-your-own styling setups
  • Fetch requests are cancelled when props change or the component unmounts when you are not using a shared client; shared clients favor deduped requests over per-component aborting
  • Rendering is powered by the shared memos-embed core package, so output stays consistent with the iframe and Web Component versions