Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
R

react-native-awesome-button

> 前端框架
Open source

React Native button component. Awesome Button is a 3D at 60fps, progress enabled, social ready, extendable, production ready component that renders an awesome a

1.3K stars0 likes1 views
WebsiteGitHub

About

React Native button component. Awesome Button is a 3D at 60fps, progress enabled, social ready, extendable, production ready component that renders an awesome a

React Native Awesome Button

@rcaferati/react-native-awesome-button brings the Awesome Button interaction, progress, sizing, and theme system to React Native with native Pressable, accessibility, and animation behavior.

The library exports:

  • AwesomeButton as the default export
  • ThemedButton
  • getTheme
  • explicit TypeScript types such as AwesomeButtonProps, ThemedButtonProps, ButtonWidth, ThemeName, ButtonVariant, and ButtonSize

Live Demo

Try the live package demo on expo.dev.

Figma File

Explore the shared Awesome Button visual system in the Figma design file. The Figma file is a visual design reference; this package's documentation defines its behavior, accessibility, and public API contract.

Installation

bash
npm install @rcaferati/react-native-awesome-button

Current peer support:

  • react >= 18.2.0
  • react-native >= 0.76.0

Basic Usage

typescript
import AwesomeButton from '@rcaferati/react-native-awesome-button';

export function SaveButton() {
  return Save;
}

AwesomeButton supports both plain string labels and arbitrary React Native content.

Features

Size Changes

animateSize is enabled by default.

  • fixed-size changes animate with the package's 175 ms size transition
  • auto-width string labels grow and shrink when their measured target width changes
  • with textTransition plus auto width:
    • wider labels start growing immediately and begin text at 30% of the text timeline
    • narrower labels begin text immediately and start shrinking at 30%
    • every transient grapheme frame is measured before it is shown, so an unconstrained auto-width label cannot wrap or clip
  • without textTransition, wider labels keep the fitting source visible until the target fits; the target remains clipped to one line until a matching native layout commit confirms physical-pixel fit, while narrower labels swap before width shrinks
  • fixed, stretch, and externally constrained transitions stay on one clipped line; stable labels regain normal wrapping after settlement
  • text scrambling uses Unicode grapheme clusters, metric-aware Latin pools, a 7 ms slot stagger, and a native frame clock
  • animateSize={false} settles target geometry before text begins; Reduced Motion settles both immediately
  • accessibility keeps exposing the stable target label rather than randomized visual frames
  • fixed-to-auto and auto-to-fixed changes remain instant in 3.1.0
typescript
import { ThemedButton } from '@rcaferati/react-native-awesome-button';

export function SizeExample({
  isLong,
  size,
}: {
  isLong: boolean;
  size: 'small' | 'medium' | 'large';
}) {
  const label = isLong ? 'Open analytics dashboard' : 'Open';

  return (
    <>
      
        {label}
      
      
        {label}
      
      
        {size}
      
    
  );
}

Progress Buttons

When progress is enabled, onPress receives a next callback. Call it when your work is done to complete the progress animation and release the button.

typescript
import AwesomeButton from '@rcaferati/react-native-awesome-button';

export function SubmitButton() {
  return (
     {
        setTimeout(() => {
          next?.();
        }, 800);
      }}
    >
      Submit
    
  );
}

Themed Buttons

typescript
import { ThemedButton } from '@rcaferati/react-native-awesome-button';

export function ThemeExample() {
  return (
    <>
      
        Rick Primary
      
      
        Rick Secondary
      
    
  );
}

If you need the full registered theme object, use getTheme.

typescript
import { ThemedButton, getTheme } from '@rcaferati/react-native-awesome-button';

export function ThemeConfigExample() {
  const theme = getTheme(0);

  return (
    
      {theme.title}
    
  );
}

getTheme() safely falls back to the default basic theme if the provided index or name is invalid.

Before / After / Extra Content

Use before and after for inline content that should animate with the label, and extra for content rendered behind the button body.

typescript
import { StyleSheet, Text } from 'react-native';
import { AntDesign } from '@expo/vector-icons';
import { LinearGradient } from 'expo-linear-gradient';
import AwesomeButton from '@rcaferati/react-native-awesome-button';

export function ButtonContentExample() {
  return (
    }
      after={}
      extra={
        
      }
    >
      Continue
    
  );
}

Transparent Buttons

transparent is supported on ThemedButton. It removes the visible shell layers while preserving the content, hit target, and active/progress feedback.

typescript
import { ThemedButton } from '@rcaferati/react-native-awesome-button';

export function TransparentExample() {
  return (
    
      Transparent
    
  );
}

Built-in Theme Contract

Theme Names

  • basic
  • bojack
  • cartman
  • mysterion
  • c137
  • rick
  • summer
  • bruce

Variants

  • primary
  • secondary
  • anchor
  • danger
  • disabled
  • flat
  • x (canonical request-only bridge)
  • twitter
  • messenger
  • facebook
  • github
  • linkedin
  • whatsapp
  • reddit
  • pinterest
  • youtube

x is the canonical social request. The legacy closed ButtonVariant and SocialButtonVariant unions still contain twitter so exhaustive v3.1 consumers remain source-compatible; ThemedButtonProps.type accepts the request-only AwesomeButtonVariant bridge, which adds x. A custom theme's optional x style wins for an x request and otherwise falls back to its required legacy twitter style. A twitter request continues to use the legacy key.

Unknown variants fall back safely at runtime instead of crashing.

Sizes

  • icon
  • small
  • medium
  • large

API Reference

The tables below cover the primary consumer-facing props. The checked-in API Extractor report and exported AwesomeButtonProps / ThemedButtonProps types are the complete public TypeScript reference.

AwesomeButton

Attribute Type Default Description
activityColor string #FFFFFF Activity indicator color shown during progress mode.
activeOpacity number 1 Opacity applied while the button is pressed.
animatedPlaceholder boolean true Enables the shimmer loop when the button has no children.
animateSize boolean true Animates fixed-size geometry changes and auto-width string-label changes.
backgroundActive string rgba(0, 0, 0, 0.15) Active overlay color rendered over the face while pressed.
backgroundColor string #c0c0c0 Main front-face background color.
backgroundDarker string #9f9f9f Bottom-face background color used for the raised 3D effect.
backgroundPlaceholder string rgba(0, 0, 0, 0.15) Placeholder bar background color when the button is empty.
backgroundProgress string rgba(0, 0, 0, 0.15) Progress bar background color used during progress mode.
backgroundShadow string rgba(0, 0, 0, 0.15) Shadow layer background color.
before ReactNode null Content rendered before the main label inside the button face.
after ReactNode null Content rendered after the main label inside the button face.
extra ReactNode null Content rendered behind the active/content layers, useful for gradients and custom backgrounds.
children ReactNode null Button label or custom content. Plain string labels also support textTransition.
borderColor string undefined Front-face border color.
borderRadius number 4 Shared border radius applied to the button face and lower layers.

Issues· 0 open

View all issuesOpen on GitHub

No open issues yet, or sync has not completed.

> Tags

TypeScriptanimatedbuttoncomponentprogress

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 17, 2026
Category前端框架
PricingOpen source

> Related tools

R
React
用于构建用户界面的 JavaScript 库
V
Vue.js
渐进式 JavaScript 框架
N
Next.js
基于 React 的全栈 Web 框架