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

@speakeasy-api/docs-md-react

v0.2.37

Published

React components used with Speakeasy's DocsMD product

Downloads

369

Readme

DocsMD React Components

This repository contains React components used with Speakeasy's Docs product. We provide these components under an open source license, and are provided as a reference for customers that wish to implement custom components.

Component Philosophy

A core philosophy of DocsMD is that any meaningful content should always be rendered inside of MDX, not as properties to a component. This way, search indexers and the like can index the content properly, and any styling that a site may provide for markdown will be applied. These behaviors usually don't happen when content is not present as markdown.

This presents some unique constraints when designing components. Notably, we can't do this:

<MyCustomHeading title="My Heading" />

In this case, anything the markdown parser does to stylize headings, such as adding a copy-link icon, will ignore this heading. That means we must instead write this as:

<MyCustomHeading>

### My Heading

</MyCustomHeading>

So if you're wondering why our components don't follow standard React component conventions, this is why. Most notably, we see this pattern with slots, described below.

Slots

Many DocsMD components take in a heterogenous set of children that need to be "assembled" into a specific structure. For example, the TabbedSection component takes in a set of children that are one of:

  • A single SectionTitle component that contains the title, aka the "Responses" heading, with slot="title"
  • A set of SectionTab components that contains the contents of each tab, aka the status code, with slot="tab"
  • A set of SectionContent components that contains the contents of each section, aka the response body, with slot="section"

Each section tab is correlated with a section component by way of "id". Admittedly we're abusing the concept of an id here, and for historical reasons the actual id on a DOM nodes comes from the headingId property (we have a task to fix that some day).

To support sorting of this "grab bag" of children, we borrow a concept from web components: slots. Each child is assigned a "slot" that is used to determine its position in the final output.

There are two hooks that are used to get components assigned to slots:

  • useUniqueChild: gets exactly one child with the given slot, and errors if there are no children with that slot or if there are multiple children with that slot.
  • useChildren: gets all children with the given slot, returned as an array

It's a little convoluted, and slightly hacky in the React world, but has proven powerful so far.

Component-Specific Documentation

See the source code for each component in the src/components directory for documentation each component. Property types are always defined in a file called types.ts, and includes documentation for each property.