PrimoDev/ apps

Esqueletão

Skeleton loading pra React Native e Expo com shimmer e pulse

  • iOS
  • Android
  • React Native
  • Expo
  • Grátis
  • Open source · MIT
Ver no GitHub

O que é o Esqueletão?

O Esqueletao é uma biblioteca de skeleton loading pra React Native e Expo, com animações shimmer e pulse feitas com Reanimated. Você monta os placeholders com o componente Skeleton e define o tema global num SkeletonProvider.

Licença MIT. O README manda instalar com npm install esqueletao, mas o pacote ainda não está publicado no npm (versão 0.0.1 no repositório), então hoje o caminho é clonar o repo e rodar npm run build.

O que ele faz

  1. 01Componente Skeleton com width, height, borderRadius, cores, margin e padding
  2. 02Animações shimmer, pulse ou nenhuma, com duração configurável
  3. 03SkeletonProvider pra definir cor base, cor de destaque e animação globais
  4. 04Helpers createSkeletonLayout pra listas, cards e avatares
  5. 05Templates prontos de card, item de lista, avatar, texto e botão
  6. 06Funciona com FlatList, FlashList e VirtualizedList
  7. 07Componentes memoizados e tipos TypeScript exportados
  8. 08Só JavaScript/TypeScript, sem código nativo próprio

Perguntas frequentes

Como instalo o Esqueletao?
O README indica npm install esqueletao, mas o pacote ainda não está no npm. Por enquanto dá pra clonar o repositório, rodar npm install e npm run build, e usar a pasta lib. Em projetos React Native CLI também precisa de react-native-reanimated e expo-linear-gradient.
Quais versões de React Native e Expo são suportadas?
As peer dependencies pedem react >= 18, react-native >= 0.73 e expo >= 50. A biblioteca usa Reanimated 4 e foi pensada pra nova arquitetura (Fabric e TurboModules). O app de exemplo usa Expo 50 e React Native 0.73.2.
Qual é a licença?
MIT.
Qual a diferença pra outras bibliotecas de skeleton?
O foco é um componente único configurável mais helpers de layout pra listas, com tema global por contexto. O shimmer usa expo-linear-gradient e as animações rodam no Reanimated.
Está pronto pra produção?
Ainda não. O projeto está na versão 0.0.1, foi criado em agosto de 2025, teve poucos commits desde então e não tem release no npm.

Documentação

README do repositório lucianodiisouza/esqueletao, atualizado a cada deploy. O texto original é em inglês.

A customizable skeleton loading library for React Native with support for the new architecture (Fabric, TurboModules) and Expo compatibility.

Features

  • 🚀 New Architecture Ready: Fully compatible with React Native 0.73+ and the new architecture
  • 📱 Expo Compatible: Works out-of-the-box with Expo managed workflow
  • 🎨 Customizable: Highly customizable components with theme support
  • ⚡ Performance: Optimized for lists with FlatList support and memoization
  • 🎭 Animations: Smooth shimmer and pulse animations using Reanimated
  • 📦 TypeScript: Full TypeScript support with proper type definitions

Installation

npm install esqueletao
# or
yarn add esqueletao

New Architecture Support

This library is fully compatible with React Native's new architecture (Fabric + TurboModules):

  • React Native 0.73+: Built with new architecture support
  • Reanimated 4: Uses JSI for optimal performance with latest features
  • Expo 50+: Full compatibility with managed workflow
  • No native code: Pure JavaScript/TypeScript implementation

Expo

The library is fully compatible with Expo and requires no additional setup for the managed workflow. Just install and use!

React Native CLI

If you're using React Native CLI, make sure you have the following dependencies installed:

npm install react-native-reanimated expo-linear-gradient

Development Setup

To run the example app locally:

# Install dependencies
npm install

# Build the library
npm run build

# Run the example app
npm run example

Quick Start

import React from "react";
import { View } from "react-native";
import { SkeletonProvider, Skeleton } from "esqueletao";

const App = () => {
  return (
    <SkeletonProvider>
      <View>
        <Skeleton width="100%" height={20} marginBottom={8} />
        <Skeleton width="80%" height={16} marginBottom={8} />
        <Skeleton width="60%" height={16} />
      </View>
    </SkeletonProvider>
  );
};

Components

SkeletonProvider

The context provider that manages global theme settings.

import { SkeletonProvider } from "esqueletao";

<SkeletonProvider
  theme={{
    baseColor: "#E1E9EE",
    highlightColor: "#F2F8FC",
    animation: "shimmer",
    duration: 1500,
  }}
>
  {/* Your skeleton components */}
</SkeletonProvider>;

Skeleton

The core skeleton placeholder component with full customization options.

import { Skeleton } from "esqueletao";

<Skeleton
  width={100}
  height={20}
  borderRadius={4}
  baseColor="#E1E9EE"
  highlightColor="#F2F8FC"
  animation="pulse"
  duration={1000}
  margin={8}
  padding={4}
/>;

List Integration

The library is designed to work with any list implementation. Here are examples with different list libraries:

With FlashList

import { Skeleton, createSkeletonLayout } from "esqueletao";
import { FlashList } from "@shopify/flash-list";

const SkeletonList = () => (
  <FlashList
    data={createSkeletonLayout.list(10)}
    renderItem={({ item }) => <Skeleton {...item} />}
    estimatedItemSize={60}
  />
);

With FlatList

import { Skeleton, createSkeletonLayout } from "esqueletao";
import { FlatList } from "react-native";

const SkeletonList = () => (
  <FlatList
    data={createSkeletonLayout.list(10)}
    renderItem={({ item }) => <Skeleton {...item} />}
    keyExtractor={(item, index) => `skeleton-${index}`}
  />
);

With VirtualizedList

import { Skeleton, createSkeletonLayout } from "esqueletao";
import { VirtualizedList } from "react-native";

const SkeletonList = () => (
  <VirtualizedList
    data={createSkeletonLayout.list(10)}
    renderItem={({ item }) => <Skeleton {...item} />}
    getItemCount={(data) => data.length}
    getItem={(data, index) => data[index]}
  />
);

Props

Common Props

All skeleton components accept these props:

Prop Type Default Description
width number | string '100%' Width of the skeleton element
height number | string 20 Height of the skeleton element
borderRadius number 4 Border radius for rounded corners
baseColor string '#E1E9EE' Base color of the skeleton
highlightColor string '#F2F8FC' Highlight color for shimmer effect
animation 'pulse' | 'shimmer' | 'none' 'shimmer' Animation type
duration number 1500 Animation duration in milliseconds
style ViewStyle - Additional styles

Skeleton Props

Additional props for the Skeleton component:

Prop Type Default Description
margin number | string - Margin around the element
padding number | string - Padding inside the element

Animation Types

Shimmer

A smooth gradient animation that moves across the element.

<Skeleton animation="shimmer" duration={1500} />

Pulse

A subtle opacity animation that fades in and out.

<Skeleton animation="pulse" duration={1000} />

None

No animation, just a static skeleton.

<Skeleton animation="none" />

Examples

Card Skeleton

import React from "react";
import { View } from "react-native";
import { SkeletonProvider, Skeleton } from "esqueletao";

const CardSkeleton = () => {
  return (
    <SkeletonProvider>
      <View
        style={
          {
            /* style the wrapper as you prefer */
          }
        }
      >
        <Skeleton
          width="100%"
          height={120}
          borderRadius={8}
          marginBottom={12}
        />
        <Skeleton width="80%" height={16} marginBottom={8} />
        <Skeleton width="60%" height={16} marginBottom={8} />
        <Skeleton width="40%" height={16} />
      </View>
    </SkeletonProvider>
  );
};

List Skeleton

import React from "react";
import { SkeletonProvider, Skeleton, createSkeletonLayout } from "esqueletao";
import { FlatList } from "react-native";

const ListSkeleton = () => {
  const skeletonItems = createSkeletonLayout.list(10);

  return (
    <SkeletonProvider>
      <FlatList
        data={skeletonItems}
        renderItem={({ item }) => <Skeleton {...item} />}
        keyExtractor={(item, index) => `skeleton-${index}`}
        showsVerticalScrollIndicator={false}
      />
    </SkeletonProvider>
  );
};

Custom Theme

import React from "react";
import { SkeletonProvider, Skeleton } from "esqueletao";

const CustomThemeExample = () => {
  return (
    <SkeletonProvider
      theme={{
        baseColor: "#2a2a2a",
        highlightColor: "#3a3a3a",
        animation: "pulse",
        duration: 2000,
      }}
    >
      <Skeleton width="100%" height={20} />
    </SkeletonProvider>
  );
};

Utilities

The library exports utility functions for animation calculations, color interpolation, and list helpers.

List Helpers

import {
  createSkeletonData,
  skeletonTemplates,
  createSkeletonLayout,
} from "esqueletao";

// Create custom skeleton data
const customSkeletons = createSkeletonData(5, {
  width: "100%",
  height: 80,
  borderRadius: 12,
});

// Use predefined templates
const cardSkeletons = createSkeletonLayout.card(3);
const listSkeletons = createSkeletonLayout.list(10);
const avatarSkeletons = createSkeletonLayout.avatar(5);

// Available templates
skeletonTemplates.card; // Card layout
skeletonTemplates.listItem; // List item layout
skeletonTemplates.avatar; // Avatar/circle layout
skeletonTemplates.text; // Text line layout
skeletonTemplates.button; // Button layout

Performance Tips

  1. Use memoization: Components are already memoized, but you can further optimize by memoizing your skeleton data.

  2. List optimization: Use your preferred list library (FlashList, FlatList, etc.) with the Skeleton component for optimal performance.

  3. Theme inheritance: Use the SkeletonProvider to set global theme defaults instead of passing props to every element.

  4. Animation control: Use animation="none" for static skeletons to improve performance.

TypeScript

The library is fully typed with TypeScript. You can import types for custom implementations:

import type { SkeletonProps, SkeletonTheme, AnimationType } from "esqueletao";

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

License

MIT License - see the LICENSE file for details.