Mood Picker
React Native (Expo)
A React Native row of faces for rating how something felt, where the chosen face swells with a bounce and shows its name.
A row of faces for rating how something felt, from awful to great. The chosen face swells with a bounce and its name appears beneath it while the others dim. The faces form a radio group, so a screen reader reads each name and which one is chosen. Built for React Native and Expo with react-native only; this page previews it in the browser through react-native-web.
Installation
CLI
npx @modus-ui/cli add mood-pickerManual
- Copy the code from the component tab.
- Create a file at
components/ui/mood-picker.tsx. - Paste the code.
It needs no packages beyond react-native, which your Expo or React Native app already has.
Usage
tsx
Props
| Prop | Type | Default | Description |
|---|---|---|---|
value | number | null | - | The chosen index, or null for none. |
onChange | (index: number) => void | - | Called with the index of the pressed face. |
icons | string[] | ["๐ก", "๐", "๐", "๐", "๐"] | One glyph per level, worst first. |
labels | string[] | ["Awful", "Bad", "Okay", "Good", "Great"] | One spoken name per level. |
colors | Partial<MoodPickerColors> | - | Overrides accent, surface and text. |
style | StyleProp<ViewStyle> | - | Style for the row. |
Comments