React Native QR Code Button for Expo

A pill that morphs into a card with a real, scannable QR code.

NewProiOS · Android · Expo Go
9:41

Props

PropTypeDefault
value

What the code encodes: a URL, a payment link, a ticket id.

string—
label

Text on the pill.

stringlabels.showQrCode
copyLabel

Copy button text.

stringlabels.copy
copiedLabel

Shown after Copy is pressed.

stringlabels.copied
closeLabel

Screen-reader name of the card's close button. Set it app-wide with KitProvider's labels.

stringlabels.close
onCopy

Wire your clipboard here (expo-clipboard).

(value: string) => void—
open

Controlled state.

boolean—
defaultOpen

Uncontrolled initial state.

booleanfalse
onOpenChange

Opened or closed.

(open: boolean) => void—
size

Pill height 36 / 44 / 52.

"sm" | "md" | "lg""md"
codeSize

Side of the code in points; the card wraps it.

number168
color

Pill colour. The card stays white so the code scans.

stringwhite (dark) / primary (light)
accessibilityLabel

Screen reader label for the pill.

stringlabel
style

Root style.

StyleProp<ViewStyle>—
className

Tailwind classes on the root when using NativeWind or Uniwind. Prefer style for StyleSheet overrides.

string—

Customization

You own the source file — tune appearance with props (no fork required for most tweaks). For brand-wide colours and radius, wrap your app in KitProvider; for one-off looks, use the style props below.

Design theme

Open Design theme on the live preview — accent, corner radius and font update every variant instantly (same as KitProvider in your app).

Variants

Use the variant chips on the preview to switch examples; each maps to a demo you can copy from the Code tab.

Style props

React Native style and typed slots like fieldStyle, plus optional root className when you use NativeWind or Uniwind (cnProps from kit).

size
"sm" | "md" | "lg" · default "md"Pill height 36 / 44 / 52.
color
string · default white (dark) / primary (light)Pill colour. The card stays white so the code scans.
style
StyleProp<ViewStyle>Root style.
className
stringTailwind classes on the root when using NativeWind or Uniwind. Prefer style for StyleSheet overrides.

Map tokens from your design system on Bring your design system or read Theming for KitProvider and NativeWind / Uniwind setup.

Behaviour & accessibility

Motion
Press swells the pill; it glides into the card while its label fades out and the code fades and scales in. Close glides it back.
Layout
Reserves the open card's size up front, so nothing around it moves and every control stays inside its own bounds (taps work on Android).
Code
Encoded in the component: UTF-8 bytes, error correction M, smallest version that fits, mask chosen by the spec's penalty rules. Always dark on white so it scans in dark mode too.
Copy
Calls onCopy with the value and flips to a tick and "Copied" for 1.5 s.
Haptics
A light impact on open, a success tap on Copy, a tick on close.
Reduced motion
Opens and closes with a short fade.
Screen readers
A button with an expanded state; the code reads as "QR code for …".

Source

FAQ

How do I make a QR code generator in React Native?
Use ExpoKit's QR Code Button, a Pro component: with ExpoKit Pro, the ExpoKit CLI copies a ready-made QR code generator into your Expo or React Native app as plain TypeScript you can edit. It works on iOS, Android and web, and in Expo Go.
Does QR Code Button work in Expo Go?
Yes. QR Code Button runs in Expo Go on iOS and Android with no development build — its packages (react-native-svg, expo-haptics) are all included in Expo Go.
How do I add QR Code Button to my Expo app?
With ExpoKit Pro, add it with the ExpoKit CLI: it copies the component's source into your app and installs react-native-svg, expo-haptics, so the code is yours to change. The install command is on this page for Pro members.
Is QR Code Button free?
QR Code Button is part of ExpoKit Pro. With a Pro plan, log the CLI in once (npx @expokit/cli@latest login) and it installs the full source into your app.
Can I change how QR Code Button looks?
Yes. It takes its colours, radius and light / dark mode from useKit(), so wrapping your app in <KitProvider accent radius> re-skins it with every other ExpoKit component. The code lives in your project, so you can also edit anything directly.