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

@unif/react-native-design

v0.4.35

Published

Unif 设计系统:theme + icons + utils + components

Downloads

5,697

Readme

@unif/react-native-design

npm CI License Docs

Unif 设计系统 —— theme + icons + utils + components,面向 React Native 0.85 新架构(Fabric + concurrent React)。

安装

yarn add @unif/react-native-design

需要在宿主工程提前安装的 peer dependencies:

yarn add react-native-svg react-native-gesture-handler react-native-reanimated \
  react-native-worklets react-native-safe-area-context \
  react-native-reanimated-carousel @gorhom/bottom-sheet @sbaiahmed1/react-native-blur

用法

在 app 根附近挂一次 ThemeProvider,并按需挂载命令式 host:

import { ThemeProvider, ToastHost, ConfirmHost } from '@unif/react-native-design';

export function App() {
  return (
    <ThemeProvider>
      {/* ...你的导航 / 屏幕... */}
      <ToastHost />
      <ConfirmHost />
    </ThemeProvider>
  );
}

组件内通过 useThemedStyles 拿当前主题的 StyleSheet:

import { Button, useThemedStyles, type ColorTokens } from '@unif/react-native-design';
import { View } from 'react-native';

// makeStyles 必须定义在模块顶层,不要写在组件里 inline
const makeStyles = (c: ColorTokens) => ({
  wrap: { padding: 16, backgroundColor: c.surface },
});

export function Demo() {
  const styles = useThemedStyles(makeStyles);
  return (
    <View style={styles.wrap}>
      <Button label="保存" onPress={() => {}} />
    </View>
  );
}

命令式 API:

import { toast, confirm } from '@unif/react-native-design';

toast.success('已保存');

const ok = await confirm({
  title: '确认注销账号?',
  message: '注销后数据无法恢复',
  destructive: true,
});

包结构

  • theme —— ThemeProvider / useTheme / useColors / useShadow / useThemedStyles,以及 color / shadow / type / space / radius / icon / control / motion 等 token,r / rf 尺寸 & 字号缩放
  • icons —— IconName 联合类型 + ICONS 数据(用 <Icon name="..." /> 渲染)
  • components/ui —— 原子组件:Button、Card、Cell、NavBar、BottomSheet、Toast、Confirm、Input、Search、Tabs、Switch 等约 37 个
  • components/business —— 通用业务复合组件:AvatarWithRing、Decorations、GlassStats、VersionPill(耦合 navigation / store 的组件留在消费者仓库)
  • utils —— createLogger(scope) 日志器、childTestID 列表型组件 testID 拼接助手

Example

example/ 是接通本库的 RN 宿主应用:

yarn
yarn example start         # metro
yarn example ios           # 或 yarn example android

源码改动会通过 Metro monorepo 配置直接热更新,不需要重新构建原生。

贡献

License

MIT