Skip to content

Instantly share code, notes, and snippets.

@mnirfan
Created March 21, 2025 07:16
Show Gist options
  • Select an option

  • Save mnirfan/2a286f3bf903e98b82b559e86a7e85b0 to your computer and use it in GitHub Desktop.

Select an option

Save mnirfan/2a286f3bf903e98b82b559e86a7e85b0 to your computer and use it in GitHub Desktop.
import './styles.css';
interface RadioButtonProps {
checked: boolean;
text: string;
onChecked: () => void;
}
export const RadioButton = ({ checked, text, onChecked }: RadioButtonProps) => {
return (
+ <radio checked={checked} text={text} bindchange={() => onChecked()}>
<view
style={{ display: 'flex', flexDirection: 'row', alignItems: 'center' }}
- bindtap={() => onChecked()}
>
<view className='radio'>
<view className={`radio-inner ${checked ? 'filled' : ''}`} />
</view>
<view>
<text
className='text'
+ accessibility-element={false}
>
{text}
</text>
</view>
</view>
+ </radio>
)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment