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

@twigwhyse/react-layout

v0.0.1

Published

可复用的布局组件,用于统一系统布局规范

Readme

@twigwhyse/react-layout

可复用的 React 布局组件库,用一致的 DOM 结构与类名约定,减少列表行、聊天区等常见界面在「空间不足 / 滚动跟随」上的重复实现。

安装

npm install @twigwhyse/react-layout

本包将 reactreact-dom 作为 peerDependencies(建议 React 18+),请在应用中自行安装对应版本。

包含的组件

| 组件 | 解决什么问题 | | --- | --- | | FlexText | 单行(或可配置换行)的「前缀 + 主文案 + 装饰 + 后缀」横向布局:中间区可压缩,两侧固定;长文案支持省略、裁切或换行等展示方式,避免图标、操作按钮被挤出视区。 | | StickToBottomScroll | 固定高度可滚动区域在「聊天、日志、实时输出」等场景下,默认贴在底部;用户上滑阅读历史时不再打断;回到底部后再次跟随新内容;内容高度或容器高度变化时仍可按状态贴底。 |

更细的 API、类名约定与行为说明见 文档目录 docs/

使用示例

import { FlexText, StickToBottomScroll } from '@twigwhyse/react-layout';

function Row() {
  return (
    <FlexText
      prefix="标签"
      text="中间主文案过长时中间省略"
      suffix="操作"
      textOverflow="ellipsis"
    />
  );
}

function LogPanel({ lines }: { lines: string[] }) {
  return (
    <StickToBottomScroll style={{ height: 200, overflowY: 'auto' }}>
      {lines.map((line) => (
        <div key={line}>{line}</div>
      ))}
    </StickToBottomScroll>
  );
}

StickToBottomScroll 已设置纵向滚动相关样式;若外层另有布局约束,可按需叠加 style/className。)

本地开发与 Storybook

组件开发与交互用例在 Storybook 中维护:

npm run storybook

构建静态文档站点:

npm run build-storybook

许可证

MIT