Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

expo-skeleton-component

Package Overview
Dependencies
Maintainers
0
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

expo-skeleton-component

Skeleton for react native and web with the latest react-native-reanimated v3

  • 1.0.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
5
decreased by-37.5%
Maintainers
0
Weekly downloads
 
Created
Source

Skeleton for react native and web with the latest react-native-reanimated v3

React native reanimated skeleton, a simple yet fully customizable component made to achieve loading animation in a Skeleton-style. Works for iOS, Android and web.

weekly downloads from npm react-native typescript javascript javascript

Installation

npm install expo-skeleton-component

Usage

  1. Import react-native-reanimated-skeleton:
import Skeleton from "expo-skeleton-component";
  1. Once you create the Skeleton, you have two options:
  • Child Layout : The component will figure out the layout of its bones with the dimensions of its direct children.
<Skeleton isLoading={true} containerStyle={styles.container}>
  <Text style={styles.normalText}>Your content</Text>
  <Text style={styles.bigText}>Other content</Text>
</Skeleton>
export default function Placeholder() {
  return (
    <Skeleton
      containerStyle={{ flex: 1, width: 300 }}
      isLoading={false}
      layout={[
        { key: "someId", width: 220, height: 20, marginBottom: 6 },
        { key: "someOtherId", width: 180, height: 20, marginBottom: 6 },
      ]}
    >
      <Text style={styles.normalText}>Your content</Text>
      <Text style={styles.bigText}>Other content</Text>
    </Skeleton>
  );
}
  1. Then simply sync the prop isLoading to your state to show/hide the Skeleton when the assets/data are available to the user.
export default function Placeholder () {
  const [loading, setLoading] = useState(true);
  return (
    <Skeleton
       containerStyle={{flex: 1, width: 300}}
        isLoading={isLoading}>
        {...otherProps}
    />
  )
}

Props

NameTypeDefaultDescription
isLoadingboolrequiredShows the Skeleton bones when true
layoutarray of objects[]A custom layout for the Skeleton bones
durationnumber1200 msDuration of one cycle of animation
containerStyleobjectflex: 1The style applied to the View containing the bones
easingEasingbezier(0.5, 0, 0.25, 1)Easing of the bones animation
animationTypestring"shiver"The animation to be used for animating the bones (see demos below)
animationDirectionstring"horizontalRight"Used only for shiver animation, describes the direction and end-point (ex: horizontalRight goes on the x-axis from left to right)
boneColorstring"#E1E9EE"Color of the bones
highlightColorstring"#F2F8FC"Color of the highlight of the bones

Keywords

FAQs

Package last updated on 28 Jun 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc