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

@amauryuh/ui

v0.6.1

Published

Reusable React layout components, styled with Tailwind CSS v4

Readme

@amauryuh/ui

Reusable React components for building app layouts. Styled with Tailwind CSS v4.

Install

npm install @amauryuh/ui

Peer dependencies: react (18+) and tailwindcss (v4).

Tailwind skips node_modules, so import the package's stylesheet after Tailwind to have it generate the classes the components use:

@import "tailwindcss";
@import "@amauryuh/ui/styles.css";

Layout

A full-screen app shell: a sidebar and a container that slide as two panes on mobile and sit side by side from md up. The container's navigation and footer float over a body with custom scrolling (momentum, rubber band, smoothed wheel). On iOS the layout follows the visual viewport, so the footer stays above the keyboard.

import { Layout, useLayout } from "@amauryuh/ui";

function App() {
  return (
    <Layout className="bg-slate-100">
      <Layout.Sidebar className="md:w-80">…</Layout.Sidebar>

      <Layout.Container>
        <Layout.Navigation>…</Layout.Navigation>
        <Layout.Body className="flex-col">…</Layout.Body>
        <Layout.Footer>…</Layout.Footer>
        <Layout.ScrollToTop />
      </Layout.Container>
    </Layout>
  );
}
  • Layout.SidebarAction closes the sidebar on click (shouldOpen opens it).
  • Layout.SidebarOpen and Layout.SidebarClosed render their children only while the sidebar is open or closed, e.g. a back button on mobile. They follow the state, not the screen: from md up both panes are always in view, so add md:hidden to content that only makes sense on mobile.
  • Layout.ScrollToTop is a round button floating above the footer that smooth-scrolls its container's body back to the top. It appears once the body is scrolled past threshold px (default 200). Pass className to restyle or move it, children to replace the icon and aria-label to translate it.
  • Edge swipe: on mobile, a finger dragged from the container's left edge past its middle (or flicked to the right) opens the sidebar, like in phone apps. The address and history stay as they are. The panes follow the finger. Touch only, never the mouse. Turn it off with <Layout edgeSwipe={false}>.
  • Layout.ScrollToBottom is the same button for the other end, e.g. the newest message of a log. It shows once the body is further than threshold px from its end.
  • <Layout.Body stickToBottom> opens scrolled to the end and, while the reader is there, keeps the end in view as content is added or the body shrinks (e.g. the phone keyboard). Scrolling up lets go.
  • useLayout() returns { sidebarOpen, setSidebarOpen }.
  • scrollBodyTo(element, top, { smooth }) scrolls a Layout.Body through its scroller, so it never fights finger or wheel momentum.
  • scrollBodyIntoView(element, { smooth }) scrolls the body holding element so it sits in the middle of what the bars leave visible.
  • useLayoutBody() returns the scrolling element of the enclosing container's body (or null before it renders).

On Android, add interactive-widget=resizes-content to the viewport meta tag so the page shrinks above the keyboard.

Every part takes a className. It can restyle a part but not override the classes the layout depends on.

Scrollable

A scrolling area with the body's scrolling (momentum, rubber band, smoothed wheel, no scrollbar), e.g. the list in a sidebar. Give it a height, e.g. flex-1 in a flex column:

import { Layout } from "@amauryuh/ui";

<Layout.Sidebar>
  <div className="flex h-full flex-col">
    <header>…</header>
    <Layout.Scrollable aria-label="Items" className="flex-1">
      <ul>…</ul>
    </Layout.Scrollable>
  </div>
</Layout.Sidebar>;

className styles the scrolling box and contentClassName the content inside it. Other props (aria-label, role, …) go on the box. Also exported on its own as Scrollable.

On touch screens, dragging a part of the layout that doesn't scroll (a bar, a sidebar header) leaves the page still: the browser doesn't pan it. Pinch zoom, sideways drags in form fields (moving the caret) and boxes that scroll natively, along their axis, keep the browser's handling.

Scroller

The custom scrolling on its own, for any scrolling element:

import { useScroller } from "@amauryuh/ui";

const { wrapper, content } = useScroller();

<div ref={wrapper} className="overflow-y-auto">
  <div ref={content}>…</div>
</div>;

Development

npm install
npm run dev        # playground at src/main.tsx
npm run build      # library to dist/
npm publish        # typechecks and builds first

Components live in src/lib and are exported from src/lib/index.ts.