@@ -36,7 +36,7 @@ import './tailwind.global.css';
36
36
37
37
``` tsx example standalone
38
38
import {RadioGroup , Radio , Label } from ' react-aria-components' ;
39
- import {CheckCircle } from ' lucide-react' ;
39
+ import {CheckCircle , Circle } from ' lucide-react' ;
40
40
41
41
function RadioGroupExample() {
42
42
return (
@@ -60,18 +60,20 @@ function ShippingOption({name, time, price}) {
60
60
${isPressed && ! isSelected ? ' bg-blue-50' : ' ' }
61
61
${! isSelected && ! isPressed ? ' bg-white' : ' ' }
62
62
` } >
63
- <div className = " flex w-full items-center justify-between gap-3" >
64
- <div className = " flex items-center shrink-0 text-blue-400 group-selected:text-white" >
65
- <CheckCircle className = " w-6 h-6" />
66
- </div >
67
- <div className = " flex flex-1 flex-col" >
68
- <div className = " text-lg font-serif font-semibold text-gray-900 group-selected:text-white" >{ name } </div >
69
- <div className = " inline text-gray-500 group-selected:text-sky-100" >
70
- { time }
63
+ { ({isSelected }) => (
64
+ <div className = " flex w-full items-center justify-between gap-3" >
65
+ <div className = " flex items-center shrink-0 text-blue-400 group-selected:text-white" >
66
+ { isSelected ? <CheckCircle className = " w-6 h-6" /> : <Circle className = " w-6 h-6" />}
67
+ </div >
68
+ <div className = " flex flex-1 flex-col" >
69
+ <div className = " text-lg font-serif font-semibold text-gray-900 group-selected:text-white" >{ name } </div >
70
+ <div className = " inline text-gray-500 group-selected:text-sky-100" >
71
+ { time }
72
+ </div >
71
73
</div >
74
+ <div className = " font-medium font-mono text-gray-900 group-selected:text-white" >{ price } </div >
72
75
</div >
73
- <div className = " font-medium font-mono text-gray-900 group-selected:text-white" >{ price } </div >
74
- </div >
76
+ )}
75
77
</Radio >
76
78
);
77
79
}
0 commit comments