Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/felipe-software/react-native-jelly-tabs/llms.txt

Use this file to discover all available pages before exploring further.

react-native-jelly-tabs exports all of its internal default values as named constants. You can import them to inspect defaults at runtime, spread them when building custom UIs, or use them as a baseline in tests.
import {
  DEFAULT_TAB_BAR_CONFIG,
  DEFAULT_TAB_BAR_COLORS,
  DEFAULT_TAB_BAR_OPACITY,
  DISTORTION,
  PILL_JELLY,
  TABBAR_LAYOUT,
  resolveTabBarConfig,
} from 'react-native-jelly-tabs';

DEFAULT_TAB_BAR_COLORS

The built-in color palette used when no colors prop is supplied. All values are solid hex strings.
const DEFAULT_TAB_BAR_COLORS: TabBarColors = {
  surface: '#22211f',
  selectedSurface: '#f2eee7',
  activeContent: '#11100f',
  inactiveContent: '#b8b4ad',
};
KeyDefaultLayer
surface#22211fTrack background fill (the dark pill container).
selectedSurface#f2eee7Selected pill fill (the light animated indicator).
activeContent#11100fIcon and label color for the active (selected) tab.
inactiveContent#b8b4adIcon and label color for inactive (unselected) tabs.
Usage — override only what you need:
import { DEFAULT_TAB_BAR_COLORS } from 'react-native-jelly-tabs';

<JellyTabBarHeadless
  items={items}
  colors={{
    ...DEFAULT_TAB_BAR_COLORS,
    selectedSurface: '#6c47ff', // swap just the pill color
  }}
/>

DEFAULT_TAB_BAR_OPACITY

Per-layer opacity defaults. All four layers default to fully opaque (1). Override individual keys via the opacity prop without affecting the others.
const DEFAULT_TAB_BAR_OPACITY: TabBarOpacity = {
  activeContent: 1,
  inactiveContent: 1,
  selectedSurface: 1,
  surface: 1,
};
KeyDefaultDescription
surface1Opacity of the track background layer.
selectedSurface1Opacity of the selected pill layer.
activeContent1Opacity of active (selected) icons and labels.
inactiveContent1Opacity of inactive icons and labels.
Usage — dim the track to let a blur backdrop show through:
import { DEFAULT_TAB_BAR_OPACITY } from 'react-native-jelly-tabs';

<JellyTabBarHeadless
  items={items}
  backdrop={<BlurView intensity={60} />}
  opacity={{
    ...DEFAULT_TAB_BAR_OPACITY,
    surface: 0.6, // semi-transparent track so the blur shows
  }}
/>

TABBAR_LAYOUT

The default values for config.layout — the physical dimensions of the track and pill. Typed as TabBarLayoutConfig.
const TABBAR_LAYOUT = {
  iconSize: 28,
  itemHeight: 56,
  maskOverscanX: 48,
  maskOverscanY: 16,
  trackHeight: 64,
  trackInset: 4,
} as const;
KeyDefaultDescription
iconSize28Base icon size passed to each TabsIcon via the size prop.
itemHeight56Height of a single tab slot and the animated pill.
trackHeight64Total height of the tab bar track.
trackInset4Padding between the outer track edge and the top/bottom of each item.
maskOverscanX48Extra horizontal pixels around the pill mask to prevent clipping during scale.
maskOverscanY16Extra vertical pixels around the pill mask for the same reason.
Usage — build a custom layout on top of the defaults:
import { TABBAR_LAYOUT } from 'react-native-jelly-tabs';

const myLayout = {
  ...TABBAR_LAYOUT,
  iconSize: 24,
  trackHeight: 60,
};

PILL_JELLY

The default values for config.pillJelly — the physics of the animated selection pill. Typed as PillJellyConfig.
const PILL_JELLY = {
  pressedScale: 1.3,
  snapOnPointerDown: true,
  frameConfig: {
    releaseDistanceFraction: 0.025,
    springs: {
      panel:    { stiffness: 300,  dampingRatio: 1   },
      press:    { stiffness: 1000, dampingRatio: 1   },
      scaleX:   { stiffness: 250,  dampingRatio: 0.6 },
      scaleY:   { stiffness: 250,  dampingRatio: 0.7 },
      value:    { stiffness: 1000, dampingRatio: 1   },
      velocity: { stiffness: 300,  dampingRatio: 0.5 },
    },
  },
} as const;

Top-level fields

KeyDefaultDescription
pressedScale1.3Scale factor applied to the pill while a finger is pressing.
snapOnPointerDowntrueSnaps the indicator toward the pressed tab immediately on pointer-down.

frameConfig

KeyDefaultDescription
releaseDistanceFraction0.025Keeps the pill inflated until it is within 2.5% of its snap point.

Springs

SpringstiffnessdampingRatioWhat it drives
panel3001.0Translation of the pill panel to the target position.
press10001.0Immediate snap on pointer-down.
scaleX2500.6Horizontal stretch/squish of the pill.
scaleY2500.7Vertical squish of the pill.
value10001.0Underlying value channel for derived animations.
velocity3000.5Velocity-tracking channel producing the jelly wobble.
Usage — tune a single spring while keeping everything else:
import { PILL_JELLY } from 'react-native-jelly-tabs';

const myPillJelly = {
  ...PILL_JELLY,
  pressedScale: 1.5,
  frameConfig: {
    ...PILL_JELLY.frameConfig,
    springs: {
      ...PILL_JELLY.frameConfig.springs,
      scaleX: { stiffness: 200, dampingRatio: 0.45 },
    },
  },
};

DISTORTION

The default values for config.distortion — the whole-track press scale, touch feedback, distortion spring, and vertical drag behavior. Typed as DistortionConfig.
const DISTORTION = {
  pressedScale: 1.025,
  touchFeedback: {
    middleOpacityRatio: 0.43,
    opacity: 0.15,
    radius: 150,
    scale: 2,
  },
  spring: {
    damping: 18,
    mass: 0.9,
    stiffness: 240,
  },
  verticalDrag: {
    distortion: 0.08,
    distanceForMaxDistortion: 700,
    follow: 0.25,
    rubberBand: 0.14,
  },
} as const;

pressedScale

KeyDefaultDescription
pressedScale1.025Subtle scale of the entire track while a finger is pressing.

touchFeedback

KeyDefaultDescription
opacity0.15Base opacity of the radial glow at the touch point.
middleOpacityRatio0.43Relative opacity at the 45% gradient stop (multiplied by opacity).
radius150Base gradient radius in logical pixels.
scale2Multiplier applied to radius; final radius = 150 × 2 = 300px.

spring

KeyDefaultDescription
damping18Damping coefficient of the distortion spring.
mass0.9Mass of the distortion spring.
stiffness240Stiffness of the distortion spring.

verticalDrag

KeyDefaultDescription
distortion0.08Width squish factor per unit of normalized vertical drag.
distanceForMaxDistortion700Drag distance (px) that saturates the distortion effect.
follow0.25Fraction of vertical drag that the bar physically follows.
rubberBand0.14Rubber-band resistance applied on top of the follow offset.
Usage — spread the distortion defaults and override one sub-object:
import { DISTORTION } from 'react-native-jelly-tabs';

const myDistortion = {
  ...DISTORTION,
  verticalDrag: {
    ...DISTORTION.verticalDrag,
    follow: 0.4,
    rubberBand: 0.2,
  },
};

DEFAULT_TAB_BAR_CONFIG

The top-level assembled config object. This is what the library uses when no config prop is passed.
const DEFAULT_TAB_BAR_CONFIG: TabBarConfig = {
  layout: TABBAR_LAYOUT,
  pillJelly: PILL_JELLY,
  distortion: DISTORTION,
};
Import it when you want a guaranteed-complete reference snapshot to inspect, clone, or diff against:
import { DEFAULT_TAB_BAR_CONFIG } from 'react-native-jelly-tabs';

// Inspect a deeply nested default
console.log(DEFAULT_TAB_BAR_CONFIG.pillJelly.frameConfig.springs.panel);
// → { stiffness: 300, dampingRatio: 1 }

// Shallow-clone the layout tier
const customLayout = {
  ...DEFAULT_TAB_BAR_CONFIG.layout,
  iconSize: 24,
};

resolveTabBarConfig

function resolveTabBarConfig(partial?: DeepPartial<TabBarConfig>): TabBarConfig
Merges a DeepPartial<TabBarConfig> override on top of all defaults and returns a complete TabBarConfig. Every nested sub-object is merged independently, so you can override a single spring without providing the other five.
import { resolveTabBarConfig } from 'react-native-jelly-tabs';

// No argument → identical to DEFAULT_TAB_BAR_CONFIG
const defaults = resolveTabBarConfig();

// Partial override → fully resolved object
const config = resolveTabBarConfig({
  layout: { iconSize: 24 },
  pillJelly: {
    pressedScale: 1.5,
    frameConfig: {
      springs: {
        scaleX: { stiffness: 200, dampingRatio: 0.45 },
      },
    },
  },
});

config.layout.trackHeight;   // 64   — default preserved
config.layout.iconSize;      // 24   — overridden
config.pillJelly.pressedScale; // 1.5  — overridden
config.pillJelly.frameConfig.springs.panel; // { stiffness: 300, dampingRatio: 1 } — default preserved

When to use resolveTabBarConfig vs. the config prop

ScenarioRecommendation
Customizing the component appearancePass a partial object directly to the config prop — no need to call resolveTabBarConfig.
Inspecting what the resolved value would beCall resolveTabBarConfig(myPartial) to get the full object for debugging or logging.
Building a custom tab bar component with your own animation hooksCall resolveTabBarConfig() to get a strongly-typed, mutable snapshot of all defaults.
Writing unit tests that assert on config valuesUse resolveTabBarConfig() to produce a deterministic baseline.

When to use the raw constants

The individual constants (TABBAR_LAYOUT, PILL_JELLY, DISTORTION) are useful when you are building a completely custom tab bar UI and want to reference the library’s design values without re-deriving them:
import {
  TABBAR_LAYOUT,
  DEFAULT_TAB_BAR_COLORS,
  DEFAULT_TAB_BAR_OPACITY,
} from 'react-native-jelly-tabs';

// Style a custom wrapper to match the Jelly track height
const styles = StyleSheet.create({
  track: {
    height: TABBAR_LAYOUT.trackHeight,  // 64
    borderRadius: TABBAR_LAYOUT.trackHeight / 2,
    backgroundColor: DEFAULT_TAB_BAR_COLORS.surface, // '#22211f'
    opacity: DEFAULT_TAB_BAR_OPACITY.surface, // 1
  },
});
They are also useful for spreading over defaults when constructing a full config object imperatively rather than through the config prop:
import { PILL_JELLY, TABBAR_LAYOUT, DISTORTION } from 'react-native-jelly-tabs';
import type { TabBarConfig } from 'react-native-jelly-tabs';

const appConfig: TabBarConfig = {
  layout: {
    ...TABBAR_LAYOUT,
    iconSize: 24,
  },
  pillJelly: {
    ...PILL_JELLY,
    pressedScale: 1.4,
  },
  distortion: {
    ...DISTORTION,
    spring: {
      ...DISTORTION.spring,
      stiffness: 280,
    },
  },
};

Build docs developers (and LLMs) love