Browse docsPicker

React Native · Expo SDK 57 New

Glass Picker

A labelled glass picker: a native menu or wheel on iOS, a dropdown on Android and a select on the web.

Installation

For Expo SDK 57 or later.

Add a components.json to your app first, as the Expo guide shows.

npx shadcn@4.14.1 add @glassyui-native/glass-picker && npx expo install --fix

Adds 14 files to components/glassyui, then matches @expo/ui, expo-blur and expo-glass-effect to your Expo SDK. Rebuild your development build after adding native packages.

Usage

Glass Picker usage

import { useState } from 'react';
import { Text, View } from 'react-native';
import { GlassPicker } from '@/components/glassyui/glass-picker';
import { useGlassTheme } from '@/components/glassyui/glass-provider';

const OPTIONS = [
  { value: 'morning', label: 'Morning' },
  { value: 'afternoon', label: 'Afternoon' },
  { value: 'evening', label: 'Evening' },
];

export default function PickerExample() {
  const { colors } = useGlassTheme();
  const [value, setValue] = useState('morning');

  return (
    <View style={{ gap: 12 }}>
      <GlassPicker
        label="Reminder"
        options={OPTIONS}
        value={value}
        onValueChange={setValue}
        testID="native-picker"
      />
      <Text style={{ color: colors.foreground }} testID="native-picker-value">
        {OPTIONS.find((option) => option.value === value)?.label}
      </Text>
    </View>
  );
}

It also uses Glass Provider. Install them together:

npx shadcn@4.14.1 add @glassyui-native/glass-picker @glassyui-native/glass-provider && npx expo install --fix

API reference

GlassPicker

The platform picker on a glass surface; generic over T extends string.

PropTypeDefaultDescription
labelRequiredstringNoneVisible label and accessible name.
optionsRequiredreadonly { label: string; value: T }[]NoneThe choices; each value must be unique.
value / onValueChangeRequiredT / (value: T) => voidNoneThe selected value and its change handler; value must match an option, or the picker throws.
appearance'menu' | 'wheel''menu'wheel shows an inline wheel on iOS; Android and the web always use a dropdown.
disabledbooleanfalsePrevents selection changes.
styleStyleProp<ViewStyle>NoneApplies to the glass surface.
testIDstringNonePassed to the native picker, or as data-testid on the web select.
Types
GlassPickerProps