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

@xiaoyu-design/rn-library

v2.0.3

Published

rn libs

Readme

@xiaoyu-design/rn-library

react-native 相关的一些封装组件

安装

npm install @xiaoyu-design/rn-library

yarn add @xiaoyu-design/rn-library

Usage

日志面板使用

  // 外层直接用这个初始化, 不用放到函数作用域
  import { setupDebugConsole } from "@xiaoyu-design/rn-library"
  const DebugConsole = setupDebugConsole();


  // 在你的根组件里面使用
  render() {
      return (
        {isTest && <DebugConsole />}
    )
  }

UI弹窗作用域控制器使用

一般用于在界面中的弹窗弹出,支持在任意作用域下弹窗

// 引入
import { UIModal, UIProviderContext, UIProviderWidget, UIModalBody } from '@xiaoyu-design/rn-library';

// UIProviderContext 确认弹窗渲染的区域,name是唯一的,但是 多个widget可以指定同一个组件,后者居上显示
// UIProviderWidget 包裹你的弹出内容组件,name是唯一的
// UIModal 就是一个modal,可以用其他组件代替,这里只是示例

// .... 省略其他代码
<UIProviderContext name={"MODAL_PAGE_VIEW"}>
  <UIProviderWidget  provider={"MODAL_PAGE_VIEW"} name={"MODAL_PAGE_VIEW_modal_demo"}>
    <UIModal
      visible={modalAction.show}
      onClose={modalAction.onClose}
      modalDirection={"bottom"}
      maskClosable
      title={"这是标题"}
      closable
    >
      <UIModalBody>
        <View style={styles.modalContent}>
          <Text>内容....</Text>
        </View>
      </UIModalBody>
    </UIModal>
  </UIProviderWidget>
</UIProviderContext>

下拉菜单组件

一般用于按钮点击,在按钮下面位置显示一个下拉菜单

import { UIDropdownMenuTarget } from '@xiaoyu-design/rn-library';

// .... 省略其他代码
 <UIDropdownMenuTarget
   visible={isDropdownVisible} // 是否显示
   onClose={handleCloseDropdown} // 关闭事件
   buttonRef={buttonRef} // 你的按钮的ref
   maskClose={false}
 >
   // 你的下拉菜单内容
 </UIDropdownMenuTarget>

tab组件

支持横向溢出可滚动,切支持 角标

  import { UIScrollTab } from '@xiaoyu-design/rn-library';

   // 示例:
    <UIScrollTab
      value={value}
      data={data}
      onChange={onChange}
      renderItemText={(e: IScrollTabRenderProps)=> {
        return e.item.label
      }}
    />

动画组件

渐入渐出 - UIFadeView

import { UIFadeView } from '@xiaoyu-design/rn-library';


// ...省略
// visible 是否显示,用来控制渐入渐出
// duration 动画过渡时间
<UIFadeView
  visible={visible}
  duration={300}
>
</UIFadeView>

Hook相关

UIHook

import { UIHook } from '@xiaoyu-design/rn-library';

// ... 省略

const appPopupAction = UIHook.usePopupAction({
  defaultShow: false
});

// appPopupAction.show // 值
// appPopupAction.onClose // 关闭
// appPopupAction.onOpen // 打开
// appPopupAction.onToggle // 取反

Sub-packages

This library also includes sub-packages for specific functionality:

  • @xiaoyu-design/rn-update: Update module for React Native applications

Installation of Sub-packages

yarn add @xiaoyu-design/rn-update
# or
npm install @xiaoyu-design/rn-update

Creating New Sub-packages

You can create new sub-packages using the provided script:

node scripts/create-update-package.js <package-name> [package-description]
# Example:
yarn create-subpackage rn-new-feature "New feature module"