iOS-style radio button for single selection
1npm install @openwebf/react-cupertino-ui1import { useState } from 'react';
2import { FlutterCupertinoRadio } from '@openwebf/react-cupertino-ui';
3
4export function RadioExample() {
5 const [selected, setSelected] = useState('a');
6
7 return (
8 <>
9 <FlutterCupertinoRadio val="a" groupValue={selected} onChange={(e) => setSelected(e.detail)} />
10 <FlutterCupertinoRadio val="b" groupValue={selected} onChange={(e) => setSelected(e.detail)} />
11 </>
12 );
13}| Name | Type | Default | Description |
|---|---|---|---|
| val | string | - | Value represented by this radio. |
| groupValue | string | - | Current selected value for the group. |
| disabled | boolean | false | Disable interactions. |
| onChange | (event: CustomEvent<string>) => void | - | Fires when selected (`event.detail` is the new group value). |