开源软件名称(OpenSource Name):hectahertz/react-native-material-dialog开源软件地址(OpenSource Url):https://github.com/hectahertz/react-native-material-dialog开源编程语言(OpenSource Language):JavaScript 100.0%开源软件介绍(OpenSource Introduction):Material design dialog components for React Native. JavaScript-only, for iOS and Android. Getting startedStep 1If you're not using Expo, install react-native-vector-icons Step 2Install react-native-material-dialog
Example
Included componentsRoadmap
MaterialDialogBasic and customizable dialog that can hold any component. import { MaterialDialog } from 'react-native-material-dialog';
<MaterialDialog
title="Use Google's Location Service?"
visible={this.state.visible}
onOk={() => this.setState({ visible: false })}
onCancel={() => this.setState({ visible: false })}>
<Text style={styles.dialogText}>
Let Google help apps determine location. This means sending anonymous
location data to Google, even when no apps are running.
</Text>
</MaterialDialog>; Props
SinglePickerMaterialDialogReady to use dialog that allows to choose only one option from a list. import { SinglePickerMaterialDialog } from 'react-native-material-dialog';
<SinglePickerMaterialDialog
title={'Pick one element!'}
items={LIST.map((row, index) => ({ value: index, label: row }))}
visible={this.state.singlePickerVisible}
selectedItem={this.state.singlePickerSelectedItem}
onCancel={() => this.setState({ singlePickerVisible: false })}
onOk={result => {
this.setState({ singlePickerVisible: false });
this.setState({ singlePickerSelectedItem: result.selectedItem });
}}
/>; Props
MultiPickerMaterialDialogReady to use dialog that allows to choose several options from a list. import { MultiPickerMaterialDialog } from 'react-native-material-dialog';
<MultiPickerMaterialDialog
title={'Pick some elements!'}
colorAccent={this.props.colorAccent}
items={LIST.map((row, index) => {
return { value: index, label: row };
})}
visible={this.state.multiPickerVisible}
selectedItems={this.state.multiPickerSelectedItems}
onCancel={() => this.setState({ multiPickerVisible: false })}
onOk={result => {
this.setState({ multiPickerVisible: false });
this.setState({ multiPickerSelectedItems: result.selectedItems });
}}
/>; Props
ReferencesLicenseContact |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论