New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

react-native-switchery

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-switchery

A customizable, iOS-inspired animated switch component for React Native

latest
Source
npmnpm
Version
0.1.2
Version published
Maintainers
1
Created
Source

react-native-switchery

npm version iOS support Android support

An iOS-inspired, highly customizable switch component for React Native that runs seamlessly on iOS and Android with smooth thumb glides, elastic pill fill, and first-class accessibility support.

Demo

Switchery demo

Features

  • 🎨 Variants & palettes – Built-in primary, info, success, warning, danger presets or override the colors directly.
  • iOS-style animation – Thumb glides first; pill fill collapses with a delayed scale for a native feel.
  • 🛠️ Fine-grained styling – Control track/thumb borders, sizes, and shadows.
  • 🧠 Accessibility ready – Switch role, disabled/checked state, custom labels and hints.

Quick Start

Installation

npm install react-native-switchery
# or
yarn add react-native-switchery

Usage

import React from 'react';
import { Switch } from 'react-native-switchery';

export const Demo = () => {
  const [value, setValue] = React.useState(false);

  return (
    <Switch
      value={value}
      onValueChange={setValue}
      variant="info"
      size="small"
    />
  );
};

Props

PropTypeDefaultDescription
valuebooleanControlled value of the switch.
onValueChange(value: boolean) => void() => {}Callback fired after a press toggles the value.
variant'primary' | 'info' | 'success' | 'warning' | 'danger'primaryBuilt-in palette presets (overridden by explicit colors).
activeColorstringvariant colorFill color when expanded.
inactiveColorstringvariant colorTrack color when collapsed.
thumbColorstringvariant colorThumb fill color.
size'mini' | 'small' | 'default' | 'large'defaultTrack/thumb preset dimensions.
trackBorderColorstringcontextualOutline color for the pill.
trackBorderWidthnumber1Outline width for the pill.
thumbBorderColorstringrgba(0,0,0,0.1)Thumb outline color.
thumbBorderWidthnumber1Thumb outline width.
disabledbooleanfalseDisables presses and shows a frosted overlay.
testIDstringswitchIdentifier for testing (overlay uses testID-disabled).
accessibilityLabelstringVoiceOver/TalkBack label.
accessibilityHintstringVoiceOver/TalkBack hint.

License

MIT © Ehtisham Ali

Keywords

react-native

FAQs

Package last updated on 14 Jan 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