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

Function Modifiers

example/app/modifiers.tsx:4–119  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

2import { Text, Modifier } from "jetpack-compose-react-native";
3
4export default function Modifiers() {
5 return (
6 <ScrollView style={{ flex: 1, padding: 20 }}>
7 <RNText style={{ fontSize: 30, fontWeight: "bold", marginVertical: 20 }}>
8 Shadow
9 </RNText>
10 <Text
11 modifier={Modifier.shadow({
12 ambientColor: "blue",
13 clip: false,
14 elevation: 10,
15 shape: "rectangle",
16 spotColor: "blue",
17 })}
18 fontSize={20}
19 >
20 Hello
21 </Text>
22 <RNText style={{ fontSize: 30, fontWeight: "bold", marginVertical: 20 }}>
23 Border
24 </RNText>
25 <Text
26 modifier={Modifier.border({
27 color: "red",
28 width: 1,
29 brush: "solid",
30 shape: "rectangle",
31 })}
32 fontSize={20}
33 >
34 Hello
35 </Text>
36 <RNText style={{ fontSize: 30, fontWeight: "bold", marginVertical: 20 }}>
37 Padding
38 </RNText>
39 <Text
40 modifier={Modifier.padding({ horizontal: 10, vertical: 20 })}
41 fontSize={20}
42 >
43 Hello
44 </Text>
45 <RNText style={{ fontSize: 30, fontWeight: "bold", marginVertical: 20 }}>
46 Width
47 </RNText>
48 <Text modifier={Modifier.width(100)} fontSize={20}>
49 Hello
50 </Text>
51 <RNText style={{ fontSize: 30, fontWeight: "bold", marginVertical: 20 }}>
52 Height
53 </RNText>
54 <Text modifier={Modifier.height(50)} fontSize={20}>
55 Hello
56 </Text>
57 <RNText style={{ fontSize: 30, fontWeight: "bold", marginVertical: 20 }}>
58 Size
59 </RNText>
60 <Text modifier={Modifier.size(100)} fontSize={20}>
61 Hello

Callers

nothing calls this directly

Calls 14

shadowMethod · 0.65
borderMethod · 0.65
paddingMethod · 0.65
widthMethod · 0.65
heightMethod · 0.65
sizeMethod · 0.65
fillMaxHeightMethod · 0.65
fillMaxWidthMethod · 0.65
fillMaxSizeMethod · 0.65
alphaMethod · 0.65
backgroundColorMethod · 0.65
backgroundBrushMethod · 0.65

Tested by

no test coverage detected