Big News: Socket raises $60M Series C at a $1B valuation to secure software supply chains for AI-driven development.Announcement
Sign In

react-native-pixel-launch

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-native-pixel-launch

Pixel Launcher-style animations for React Native — overlay transitions, dialogs, bottom sheets, and dome footer with FAB menu

latest
Source
npmnpm
Version
1.1.0
Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

react-native-pixel-launch

Pixel Launcher-style animations for React Native and Expo — overlay transitions, dialogs, bottom sheets, dome footer with FAB menu, and categorized menu grid with search.

Preview

v1.0 — Pixel Launch Overlayv1.1 — Full Component Suite
v1.0 Demov1.1 Demo

Features

  • PixelLaunchContainer — Full-screen overlay that scales from any element (like Android's Pixel Launcher app-open animation)
  • PixelDialog — Custom alert dialog that expands from an origin point to screen center
  • AnimatedBottomSheet — Bottom sheet with slide animation + stagger items
  • DomeFooter — SVG dome bar footer with circular FAB button cutout
  • FabMenu — Expandable floating action button menu with staggered spring animations
  • PixelMenuGrid — Data-driven, categorized icon grid with scale-on-press animation
  • PixelMenuOverlay — Search bar + categorized menu grid combo
  • Runs on the native thread (useNativeDriver: true) for smooth 60/120 Hz
  • Works with both Expo and bare React Native
  • TypeScript support built-in
  • Zero required dependencies (only react and react-native)
  • Optional react-native-svg peer dependency (only needed for DomeFooter)

Installation

npm install react-native-pixel-launch
# or
yarn add react-native-pixel-launch

If you want to use DomeFooter / FabMenu, also install:

npm install react-native-svg

Components

1. PixelLaunchContainer

Full-screen overlay that scales up from an origin rect and collapses back on close.

import { useState, useRef } from "react";
import { View, TouchableOpacity, Text } from "react-native";
import { PixelLaunchContainer, type LaunchOrigin } from "react-native-pixel-launch";

export default function App() {
  const [visible, setVisible] = useState(false);
  const [origin, setOrigin]   = useState<LaunchOrigin | null>(null);
  const btnRef                = useRef<View>(null);

  const handleOpen = () => {
    btnRef.current?.measure((_x, _y, width, height, pageX, pageY) => {
      setOrigin({ x: pageX, y: pageY, width, height });
      setVisible(true);
    });
  };

  return (
    <View style={{ flex: 1 }}>
      <TouchableOpacity ref={btnRef} onPress={handleOpen}>
        <Text>Open</Text>
      </TouchableOpacity>

      <PixelLaunchContainer
        visible={visible}
        origin={origin}
        onClose={() => setVisible(false)}
        onDismissed={() => console.log("fully closed")}
        backgroundColor="#FFFFFF"
      >
        <View style={{ flex: 1, alignItems: "center", justifyContent: "center" }}>
          <Text>Your screen content here</Text>
          <TouchableOpacity onPress={() => setVisible(false)}>
            <Text>Close</Text>
          </TouchableOpacity>
        </View>
      </PixelLaunchContainer>
    </View>
  );
}

Props

PropTypeRequiredDefaultDescription
visiblebooleanYes--Controls open/close state
originLaunchOrigin | nullYes--Screen-absolute rect of the trigger element
onClose() => voidYes--Called when user wants to close
onDismissed() => voidNo--Called after close animation completes
backgroundColorstringNo"#FFFFFF"Overlay background colour
zIndexnumberNo200zIndex of the overlay
childrenReactNodeYes--Content rendered inside the overlay

2. PixelDialog

Custom dialog that replaces native Alert — scales from an origin point to screen center.

import { PixelDialog } from "react-native-pixel-launch";

<PixelDialog
  visible={showDialog}
  origin={dialogOrigin}
  title="Delete Item?"
  message="This action cannot be undone."
  icon={<MyIcon />}
  buttons={[
    { label: "Cancel", style: "cancel", onPress: () => setShowDialog(false) },
    { label: "Delete", style: "destructive", onPress: handleDelete },
  ]}
  onDismiss={() => setShowDialog(false)}
/>

Props

PropTypeRequiredDefaultDescription
visiblebooleanYes--Controls visibility
originLaunchOrigin | nullYes--Origin rect of trigger element
titlestringYes--Dialog title
messagestringNo--Body text below title
iconReactNodeNo--Icon rendered above the title
buttonsPixelDialogButton[]Yes--Array of buttons
onDismiss() => voidNo--Called on backdrop tap

PixelDialogButton

type PixelDialogButton = {
  label: string;
  style?: "default" | "cancel" | "destructive";
  onPress: () => void;
};

3. AnimatedBottomSheet

Bottom sheet with slide-up animation, drag-to-dismiss, and stagger items.

import { AnimatedBottomSheet, StaggerItem } from "react-native-pixel-launch";

<AnimatedBottomSheet
  visible={isOpen}
  onClose={() => setIsOpen(false)}
  title="Options"
  bottomOffset={80}
  backgroundColor="#FFFFFF"
>
  <StaggerItem index={0}><Text>Row 1</Text></StaggerItem>
  <StaggerItem index={1}><Text>Row 2</Text></StaggerItem>
  <StaggerItem index={2}><Text>Row 3</Text></StaggerItem>
</AnimatedBottomSheet>

Props

PropTypeRequiredDefaultDescription
visiblebooleanYes--Controls open/close
onClose() => voidYes--Called on backdrop tap or swipe down
titlestringNo--Header title
bottomOffsetnumberNo0Distance from screen bottom
originXnumberNocenterX position the sheet scales from
maxHeightRationumberNo0.80Max height as fraction of screen
backgroundColorstringNo"#FFFFFF"Sheet background color
titleColorstringNo"#111827"Title text color
handleColorstringNo"#E5E7EB"Drag handle color
dividerColorstringNo"#F3F4F6"Divider line color
backdropMaxOpacitynumberNo0.45Backdrop opacity when open
childrenReactNodeNo--Sheet content

4. DomeFooter

SVG dome bar footer with circular cutout for a floating action button.

import { DomeFooter, FOOTER_BAR_H } from "react-native-pixel-launch";
import { useSafeAreaInsets } from "react-native-safe-area-context";

function MyFooter() {
  const insets = useSafeAreaInsets();
  const barH = FOOTER_BAR_H + insets.bottom;

  return (
    <DomeFooter
      barH={barH}
      primaryColor="#6C63FF"
      footerColor="#1E1E30"
      brandText="My App"
      isFabOpen={fabOpen}
      isSheetOpen={sheetOpen}
      isMenuOpen={menuOpen}
      onToggleFab={() => setFabOpen(!fabOpen)}
      onCloseSheet={() => setSheetOpen(false)}
      onCloseMenu={() => setMenuOpen(false)}
      renderIcon={(name) => (
        <Text style={{ color: "#FFF", fontSize: 22 }}>
          {name === "menu" ? "☰" : "✕"}
        </Text>
      )}
    />
  );
}

Props

PropTypeRequiredDefaultDescription
barHnumberYes--Total bar height (FOOTER_BAR_H + safe area)
primaryColorstringYes--Brand colour for FAB button
footerColorstringYes--Footer bar background colour
brandTextstringNo""Text shown on the footer bar
onBack() => voidNo--Sub-screen mode: shows close button
isSheetOpenbooleanNofalseWhether a sheet overlay is open
isFabOpenbooleanNofalseWhether the FAB menu is open
isMenuOpenbooleanNofalseWhether the menu is open
onCloseSheet() => voidNo--Close sheet callback
onToggleFab() => voidNo--Toggle FAB menu callback
onCloseMenu() => voidNo--Close menu callback
renderIcon(name) => ReactNodeNo--Custom icon renderer

5. FabMenu

Expandable floating action button menu with staggered spring animations.

import { FabMenu } from "react-native-pixel-launch";

<FabMenu
  isOpen={fabOpen}
  bottomOffset={barH}
  primaryColor="#6C63FF"
  items={[
    {
      key: "menu",
      icon: <Text style={{ color: "#FFF" }}></Text>,
      label: "Menu Items",
      onPress: () => openMenu(),
    },
    {
      key: "settings",
      icon: <Text style={{ color: "#FFF" }}></Text>,
      label: "Settings",
      onPress: () => openSettings(),
    },
  ]}
  onClose={() => setFabOpen(false)}
/>

Props

PropTypeRequiredDefaultDescription
isOpenbooleanYes--Controls menu visibility
bottomOffsetnumberYes--Distance from screen bottom
primaryColorstringYes--Colour for FAB buttons
itemsFabMenuItem[]Yes--Menu items to display
onClose() => voidYes--Close callback

6. PixelMenuGrid

Data-driven, categorized icon grid with scale-on-press animation and LaunchOrigin measurement.

import { PixelMenuGrid, type PixelMenuItem } from "react-native-pixel-launch";
import Icon from "@expo/vector-icons/MaterialCommunityIcons";

type MyItem = PixelMenuItem & { icon: string };

const items: MyItem[] = [
  { key: "home", title: "Home", icon: "home", color: "blue", category: "Main", order: 1 },
  { key: "chat", title: "Chat", icon: "chat", color: "green", category: "Main", order: 2 },
  { key: "settings", title: "Settings", icon: "cog", color: "gray", category: "Other", order: 3 },
];

<PixelMenuGrid
  items={items}
  primaryColor="#6C63FF"
  renderIcon={(item, color, size) => (
    <Icon name={item.icon as any} size={size} color={color} />
  )}
  onItemPress={(item, origin) => {
    // origin has { x, y, width, height } for PixelLaunchContainer
    console.log("Pressed", item.title, origin);
  }}
/>

Props

PropTypeRequiredDefaultDescription
itemsPixelMenuItem[]No--Flat list (auto-grouped by category)
sectionsPixelMenuSection[]No--Pre-grouped sections
renderIcon(item, color, size) => ReactNodeYes--Icon renderer
onItemPress(item, origin) => voidNo--Press callback with measured position
searchTermstringNo""Filter items by title
primaryColorstringNo"#2563EB"Accent color for section headers
iconCircleColorstringNo"#FFFFFF"Icon circle background
labelColorstringNo"#1F2937"Card label text color
columnsnumberNo4Number of grid columns
iconSizenumberNo64Icon circle diameter
bottomPaddingnumberNo0Extra bottom padding

7. PixelMenuOverlay

Search bar + categorized menu grid combo. Manages search state internally.

import { PixelMenuOverlay } from "react-native-pixel-launch";

<PixelMenuOverlay
  items={menuItems}
  primaryColor="#6C63FF"
  iconCircleColor="#1E1E30"
  labelColor="#CBD5E0"
  searchBackgroundColor="#1E1E30"
  searchTextColor="#FFFFFF"
  searchPlaceholderColor="#718096"
  bottomPadding={100}
  renderIcon={(item, color, size) => (
    <Icon name={item.icon} size={size} color={color} />
  )}
  onItemPress={(item, origin) => openScreen(item, origin)}
/>

Props

Inherits all PixelMenuGrid props (except searchTerm) plus:

PropTypeRequiredDefaultDescription
searchPlaceholderstringNo"Search in menu"Input placeholder
searchBackgroundColorstringNo"#FFFFFF"Search pill background
searchTextColorstringNo"#202124"Search input text color
searchPlaceholderColorstringNo"#9AA0A6"Placeholder text color
searchShadowColorstringNoprimaryColorSearch pill shadow color
renderSearchIcon() => ReactNodeNo--Custom search icon
renderClearIcon() => ReactNodeNo--Custom clear icon
showSearchbooleanNotrueShow/hide search bar
headerContentReactNodeNo--Content above search bar

Types

LaunchOrigin

type LaunchOrigin = {
  x: number;      // pageX from ref.measure()
  y: number;      // pageY from ref.measure()
  width: number;
  height: number;
};

PixelMenuItem

type PixelMenuItem = {
  key: string;        // Unique identifier
  title: string;      // Display label
  color?: string;     // Icon color (hex or named: "red", "blue", etc.)
  category?: string;  // Section grouping
  order?: number;     // Sort order within category
};

PixelMenuSection

type PixelMenuSection<T extends PixelMenuItem = PixelMenuItem> = {
  category: string;
  items: T[];
};

FabMenuItem

type FabMenuItem = {
  key: string;
  icon: React.ReactNode;
  label: string;
  onPress: () => void;
};

Exported Constants

ConstantValueDescription
FOOTER_BAR_H56Footer bar height (without safe area)
DOME_R50Dome radius
DOME_CXscreenWidth - 58Dome center X position
BTN_R30FAB button radius
CUP_RIM_R39Dome cutout rim radius

Named Colors

PixelMenuGrid resolves named colors automatically:

red orange yellow green teal blue indigo violet purple pink cyan gray brown lime amber

You can extend or override these with the namedColors prop.

License

MIT — made by Sourabh Patidar

Keywords

react-native

FAQs

Package last updated on 13 Jun 2026

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