Open History to see the last commit
1import { View } from "react-native";
2
3import { cn } from "../../lib/cn";
4
5// Material's radio, drawn with views: a Compose RadioButton needs a Compose host per row, and
6// mounting hundreds of those made long pickers stutter while scrolling.
7/** The enclosing radio row owns selection, touch and accessibility. */
8export function RadioIndicator({ selected }: { readonly selected: boolean }) {
9 return (
10 <View
11 pointerEvents="none"
12 importantForAccessibility="no-hide-descendants"
13 className="size-6 items-center justify-center"
14 >
15 <View
16 className={cn(
17 "size-5 items-center justify-center rounded-full border-2",
18 selected ? "border-primary-text" : "border-foreground-muted",
19 )}
20 >
21 {selected ? <View className="size-2.5 rounded-full bg-primary-text" /> : null}
22 </View>
23 </View>
24 );
25}