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

@compass-aiden/vwb-material-text

v0.0.1

Published

>

Downloads

7

Readme

vwb-atomic-text

Features

  • Auto Import

支持自动导入'react', 'react-i18next'等库

export default function Demo() {
  const [] = useState(0);
  const { t } = useTranslation();

  return <>{t('message.common.test')}</>;
}
  • Icons

项目内置了 unplugin-icons, 请参考文档使用

所有 icon 支持自动导入,无需手动 import,依赖自动安装,类似如下方式直接使用即可:

在 https://icon-sets.iconify.design/ 可以直接搜索所有 icon 资源,antd 的 icon 也一样存在

更多用法参考 unplugin-icons 官方文档即可

export default function Demo() {
  return (
    <>
      <IconAntDesignSearchOutlined />
    </>
  );
}
  • vite-plugin-svgr
import DemoIcon from '@/assets/svg/demo.svg';

export default function Demo() {
  return (
    <>
      <DemoIcon />
    </>
  );
}
  • postcss & autoprefixer & tailwindcss
export default function Demo() {
  return (
    <>
      <p className="underline">Test</p>
    </>
  );
}
  • Stores & Theme

创建 Store 参考: src/stores/theme.store.ts,然后在 src/stores/store.tsx 内使用

组件用法示例:

import { ThemeContext, useThemeStore } from '@/stores';

export default function Demo() {
  const { theme } = useContext(ThemeContext);
  const { getThemeInstance } = useThemeStore();

  function toggleTheme(themeKey: string) {
    getThemeInstance().toggle(themeKey);
  }

  return (
    <>
      当前主题: {theme}
      <button onClick={() => toggleTheme('default')} type="button">
        切换默认主题
      </button>
      <br />
      <button onClick={() => toggleTheme('light')} type="button">
        切换亮色主题
      </button>
      <br />
      <button onClick={() => toggleTheme('dark')} type="button">
        切换暗黑主题
      </button>
    </>
  );
}
  • Base Styles & BEM.scss

全局样式src/assets/styles/global.scss

默认导入所有样式表顶部src/assets/styles/base/variables.scss,并导入 bem.scss,domain 前缀可通过 variables.scss 内变量修改

@include b(demo) {
  // .cp-demo
  color: red;
  height: 2000px;
  @include e(element) {
    // .cp-demo__element
    @include m(modify) {
      // .cp-demo__element_modify
    }
  }
}
  • I18n
export default function Demo() {
  const { t, i18n } = useTranslation();
  function toggleLang(lang: string) {
    i18n.changeLanguage(lang);
  }
  return (
    <>
      当前语言环境: {i18n.language}
      {t('message.common.test')}
      <button onClick={() => toggleLang('en')} type="button">
        使用英语
      </button>
      <br />
      <button onClick={() => toggleLang('zh-CN')} type="button">
        使用中文
      </button>
    </>
  );
}
  • Eslint

使用 Airbnb Eslint 规则

npm run lint 执行检查

  • Prettier

npm run format 执行检查