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 🙏

© 2025 – Pkg Stats / Ryan Hefner

@tuya-oh/rn-placeholder

v3.0.3-0.0.1

Published

在 React Native 中呈现文本或媒体内容之前显示一些占位符

Readme

模板版本:v3.0.3-0.0.1

[!TIP] Git 地址

安装与使用

进入到工程目录并输入以下命令:

npm

npm install @tuya-oh/rn-placeholder

yarn

yarn add  @tuya-oh/rn-placeholder

下面的代码展示了这个库的基本使用场景:

import {
  Placeholder,
  PlaceholderMedia,
  PlaceholderLine,
  Fade,
} from "rn-placeholder";

const App = () => (
  <Placeholder
    Animation={Fade}
    Left={PlaceholderMedia}
    Right={PlaceholderMedia}
  >
    <PlaceholderLine width={80} />
    <PlaceholderLine />
    <PlaceholderLine width={30} />
  </Placeholder>
);
export default App;

约束与限制

兼容性

本文档内容基于以下版本验证通过:

  1. RNOH:0.72.27; SDK:HarmonyOS-Next-DB1 5.0.0.29(SP1) ; IDE:DevEco Studio 5.0.3.400; ROM:3.0.0.25;

属性

[!TIP] "Platform"列表示该属性在原三方库上支持的平台。

[!TIP] "HarmonyOS Support"列为 yes 表示 HarmonyOS 平台支持该属性;no 则表示不支持;partially 表示部分支持。使用方法跨平台一致,效果对标 iOS 或 Android 的效果。

组件 Placeholder

It's the wrapper around all of the other components. Using alone will not produce anything interesting. You have put some line or media inside to make it powerful.It accepts all the props of a React Native View plus:

| Name | Description | Type | Required | Platform | HarmonyOS Support | | --------- | --------------------------------------------------- | ------------- | -------- | -------- | ----------------- | | Animation | An optional component that animates the placeholder | Animations | no | All | Yes | | Left | An optional component to display on the left | ComponentType | no | All | Yes | | Right | An optional component to display on the right | ComponentType | no | All | Yes |

Animations

| Name | Description | Type | Required | Platform | HarmonyOS Support | | --------- | -------------------------------------------------- | ------------- | -------- | -------- | -------- | | Fade | This is the base animation that makes the placeholder become clearer on a specified interval| ComponentType | no | All | Yes | | ShineOverlay | This applies a tiny overlay from left to right of the placeholder. It's pretty neat but it has the drawback to only work without style customization: only on white background with gray lines |ComponentType| no | All | Yes | | Shine | The shine animation is an attempt to overcome the overlay problem of the ShineOverlay animation by animating only the differnt part of the placeholder | ComponentType | no | All | Yes | | Loader | A simple placeholder animation based on the standard loader (ActivityIndicator) of each platforms | ComponentType | no | All | Yes | | Progressive | A progressive loading animation effect | ComponentType | no | All | Yes | | Tweaking existing animations | It's possible to tweak a specific animation by passing it additional props. However keep in mind that it's important to spread the props from the Animation render function. Else you will be in strange behaviors| ComponentType | no | All | Yes |

组件 PlaceholderLine

A PlaceholderLine is one of the two basic and visual components of a placeholder.

| Name | Description | Type | Required | Platform | HarmonyOS Support | | -------- | ---------------------------------------------------------------------- | ------- | -------- | -------- | ----------------- | | height | The line height, default is 12 | number | no | All | Yes | | color | The line color, default is #efefef | string | no | All | Yes | | width | The line width in percent, default is 100(%) | number | no | All | Yes | | noMargin | Defines if a line should have a margin bottom or not, default is false | boolean | no | All | Yes | | style | Customize the style of the underlying View component | object | no | All | Yes |

组件 PlaceholderMedia

A PlaceholderMedia is the second of the two basic and visual components of a placeholder. It can be used a single placeholder like following:

| Name | Description | Type | Required | Platform | HarmonyOS Support | | ------- | -------------------------------------------------------- | ------- | -------- | -------- | ----------------- | | size | The media size (height / width), default is 40 | number | no | All | Yes | | isRound | Defines if the media is rounded or not, default is false | boolean | no | All | Yes | | color | The media color, default is #efefef | string | no | All | Yes | | style | Customize the style of the underlying View component | object | no | All | Yes |

遗留问题

其他

开源协议

本项目基于 The MIT License (MIT) ,请自由地享受和参与开源。