MCPcopy Create free account
hub / github.com/andrew-levy/jetpack-compose-react-native / ChipsExample

Function ChipsExample

example/app/chips.tsx:5–41  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

3import { useState } from "react";
4
5export default function ChipsExample() {
6 const [filterChipSelected, setFilterChipSelected] = useState(false);
7 const [inputChipSelected, setInputChipSelected] = useState(false);
8
9 return (
10 <View style={styles.container}>
11 <Text style={styles.header}>Chip Example</Text>
12 <Chip
13 variant="assist"
14 labelText="Assist"
15 leadingIcon="person"
16 trailingIcon="close"
17 modifier={Modifier.border({ width: 1, color: "green" })}
18 />
19 <Chip
20 variant="input"
21 modifier={Modifier.border({ width: 1, color: "green" })}
22 labelText="Input"
23 leadingIcon={inputChipSelected ? "check" : undefined}
24 selected={inputChipSelected}
25 onClick={() => {
26 setInputChipSelected(!inputChipSelected);
27 }}
28 />
29 <Chip
30 variant="filter"
31 labelText="Filter"
32 trailingIcon="box"
33 selected={filterChipSelected}
34 onClick={() => {
35 setFilterChipSelected(!filterChipSelected);
36 }}
37 />
38 <Chip variant="suggestion" labelText="Suggestion" />
39 </View>
40 );
41}
42
43const styles = StyleSheet.create({
44 container: {

Callers

nothing calls this directly

Calls 1

borderMethod · 0.65

Tested by

no test coverage detected