@ovok/native/picker-sheet

Wheel pickers and the bottom picker sheet.

  • Stable unknown
  • Release candidate since 1.16.1-rc.3
  • Development since 1.16.1-dev.2111+9796905

Wheel pickers and the bottom picker sheet.

Import from @ovok/native/picker-sheet.

Components

PickerSheet

const PickerSheet: NamedExoticComponent<PickerSheetProps & RefAttributes<BottomSheetModal>>;

Bottom sheet modal that sizes itself to its content; the ref is the underlying modal.


WheelPicker

const WheelPicker: MemoExoticComponent<(__namedParameters) => Element>;

Vertical snapping wheel for choosing one option from a list.


ValueWheelPicker()

function ValueWheelPicker<T>(__namedParameters): Element;

Wheel picker over typed option values.

Type Parameters

Type Parameter
T

Parameters

ParameterType
__namedParametersValueWheelPickerProps<T>

Returns

Element

Interfaces

WheelPickerProps

Props for WheelPicker.

Properties

PropertyTypeDescription
accessibilityDecrementLabel?stringAccessibility label for the decrement action.
accessibilityHint?stringAccessibility hint for the picker.
accessibilityIncrementLabel?stringAccessibility label for the increment action.
accessibilityLabel?stringAccessibility label for the picker.
containerProps?Omit<ViewProps, "style">Extra props passed to the container view.
containerStyle?StyleProp<ViewStyle>Style for the outer container.
decelerationRate?number | "normal" | "fast"Scroll deceleration rate; defaults to "fast".
itemHeight?numberHeight of one row; defaults to 40.
itemStyle?StyleProp<ViewStyle>Style for each option row.
itemTextStyle?StyleProp<TextStyle>Style for each option's text.
nestedScrollEnabled?booleanWhether nested scrolling is enabled on Android; defaults to true.
onChange(index) => voidCalled with the new index when the user settles on an option.
optionsstring[]Option labels, in display order.
selectedIndexnumberIndex of the selected option.
selectedIndicatorStyle?StyleProp<ViewStyle>Style for the highlight behind the selected row.
visibleItems?numberNumber of rows visible at once; defaults to 5.

Type Aliases

ValueWheelPickerProps

type ValueWheelPickerProps<T> = Omit<WheelPickerProps, "options" | "selectedIndex" | "onChange"> & object;

Props for ValueWheelPicker; also accepts WheelPickerProps except options, selectedIndex and onChange.

Type Parameters

Type Parameter
T

Type Declaration

NameTypeDescription
defaultIndex?numberSelects a display-only option when value is unset. It is not reported through onChange until the person manipulates the picker.
getOptionKey()?(value) => stringSupplies value equality for non-primitive option values.
onChange()(value) => voidCalled with the chosen option's value once the user settles on it.
optionsreadonly WheelPickerOption<T>[]Options in display order.
value?T | nullCurrently selected value.

WheelPickerOption

type WheelPickerOption<T> = object;

A wheel option pairing a display label with its value.

Type Parameters

Type Parameter
T

Properties

label
label: string;

Text shown for the option.

value
value: T;

Value reported when the option is chosen.

Last updated on

On this page