chipselector_by_kabeer
Version:
<div id="top"></div>
44 lines (35 loc) • 1.1 kB
JavaScript
import React, {useEffect, useState} from 'react';
import {SafeAreaView, View,StyleSheet} from 'react-native';
import CustomChipSelector from './CustomComponents/CustomChipSelector';
function App(props) {
const [category, setCategory] = useState([]);
const categoriesList = [
{id: 1, name: 'category'},
{id: 2, name: 'cat2'},
{id: 3, name: 'cat1'},
{id: 4, name: 'cat1'},
{id: 5, name: 'cat1'},
{id: 6, name: 'cat1'},
{id: 7, name: 'cat1'},
];
return (
<SafeAreaView>
<CustomChipSelector
chipsViewStyle={styles.chipViewStyle}
options={categoriesList}
selectedValue={category}
onSelectedValue={setCategory}
multi={true}
/>
</SafeAreaView>
);
}
export default App;
const styles=StyleSheet.create({
chipViewStyle:{
backgroundColor:'#F0F5FC',
fontColor:'#ba1f24',
borderColor:'#ba1f24',
fontWeight:'bold'
}
})