- Welcome
- Getting started
- Latest updates
- Monthly updates
- Foundations
-
Components
- Accordion
- Alert
- Alignment
- App Search Modal
- Aria live
- Autosuggest
- Badge
- Banner alert
- Bar chart
- Blockquote
- Bottom navigation
- Bottom sheet
- Breadcrumb
- Breakpoint
- Button
- Calendar
- Card
- Card list
- Card button
- Carousel
- Checkbox
- Chip
- Chip group
- Code
- Content cards
- Data Table
- Datepicker
- Description list
- Dialog
- Divider
- Drawer
- Field Set
- Flare
- Flat list
- Flight leg
- Floating action button
- Floating notification
- Form label
- Form validation
- Graphic promotion
- Horizontal navigation
- Icon
- Image
- Infinite scroll
- Info Banner
- Link
- List
- Map
- Mobile scroll container
- Modal
- Navigation bar
- Nudger
- Overlay
- Page indicator
- Pagination
- Panel
- Phone input
- Picker
- Popover
- Price
- Progress bar
- Radio button
- Rating
- Scrollable calendar
- Search Modal
- Section header
- Section list
- Select
- Skeleton
- Skip link
- Slider
- Snackbar
- Snippet
- Spinner
- Split input
- Star rating
- Switch
- Table
- Text
- Text input
- Theming
- Ticket
- Toast
- Tooltip
- Touchable native feedback
- Touchable overlay
- Content
- Accessibility
- Contributing
Select
Selects allow users to select from a single-option menu.
bpk-component-select
Backpack React Native select component.
Default
Day | Night |
---|---|
![]() |
![]() |
![]() |
![]() |
Installation
Check the main Readme for a complete installation guide.
Usage
import React from 'react';
import { View, StyleSheet } from 'react-native';
import { spacingBase } from '@skyscanner/bpk-foundations-react-native/tokens/base.react.native';
import BpkSelect from 'backpack-react-native/bpk-component-select';
const styles = StyleSheet.create({
container: {
flex: 1,
justifyContent: 'center',
padding: spacingBase,
}
});
export default () => (
<View styles={styles.container>
<BpkSelect
onPress={openSelectUI}
label="Select an Option"
/>
<BpkSelect
onPress={openSelectUI}
label="Select an Option"
valid={false}
validationMessage="An option must be selected to continue"
/>
</View>
);
Props
Property | PropType | Required | Default Value |
---|---|---|---|
onPress | func | true | - |
disabled | bool | false | false |
focused | bool | false | false |
label | oneOfType(string, element) | false | null |
valid | oneOf(true, false, null) | false | null |
validationMessage | string | false | null |
Made with ❤️ by Skyscanner © 2023
© 2023 Skyscanner Backpack. Page last updated on Jul 25, 2023, 08:27