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

hg-react-slot

v0.2.3

Published

A React implementation of slots.

Downloads

6

Readme

hg-react-slot

build codecov NPM npm

A React implementation of slots.

Install

yarn add hg-react-slot

or with npm:

npm install --save hg-react-slot

Usage

Create a component with hg-react-slot :

// MyComponent.js
import React from "react";
import { Slot, withSlot } from "hg-react-slot";

const MyComponent = () => (
  <div>
    <header>
      <Slot name="header" />
      {/* `<span>anonymity</span>` will be defalut content for Slot(author) */}
      <Slot name="author">
        <span>anonymity</span>
      </Slot>
    </header>
    <main>
      {/* `<Slot />` is equivalent to `<Slot name="default" />`  */}
      <Slot />
    </main>
    <footer>
      <Slot name="footer" />
    </footer>
  </div>
);

export default withSlot(MyComponent);

In other components, you can use MyComponent like this:

// App.js
import React from "react";
import MyComponent from "./MyComponent.js";

// Because React.Fragment can only have `key` and `children` props,
// if you need to use React.Fragment, you should create a component like this:
const Frag = ({ children }) => <React.Fragment>{children}</React.Fragment>;

export default () => (
  <div>
    <div>Other Content</div>
    <MyComponent>
      <Frag slot="footer">Footer Content</Frag>
      {/* `<Frag>` is equivalent to `<Frag slot="default">`  */}
      <Frag>
        <p>paragraph1</p>
        <p>paragraph2</p>
      </Frag>
      <h3 slot="header">Header Content</h3>
    </MyComponent>
  </div>
);

After running the above code, resulting HTML is:

<div>
  <div>Other Content</div>
  <div>
    <header>
      <h3 slot="header">Header Content</h3>
      <span>anonymity</span>
    </header>
    <main>
      <p>paragraph1</p>
      <p>paragraph2</p>
    </main>
    <footer>Footer Content</footer>
  </div>
</div>

Change Log

2019.4.7

v0.2.3 Update README

2019.3.30

v0.2.2 Add travis-ci and codecov

2019.3.29

v0.2.0 Add unit test

2019.3.28

v0.1.0 Initialize project