Due to limited horizontal display space on mobile devices, Radio defaults to vertical layout. Horizontal layout is recommended only for simple use cases. When there are multiple options, longer content, or more display content, vertical layout is recommended.
Radio accepts a value prop as the initial identifier for internal Radio items. When a RadioItem is clicked, Radio can get the current value through the onchange event, which is the name of the currently selected RadioItem.
The default value 'default' for Radio Props' icon will render as an Icon component using Remix Icon's ri-checkbox-blank-circle-line. Passing null means no content will be displayed in the unchecked option's icon area. You can also pass Icon Props, and the unchecked option's icon area will render as an Icon component with the passed parameters.
iconChecked follows the same logic as icon, corresponding to the icon area content of the selected option.
When radioChild is passed, the content area of each RadioItem in Radio will use the content area of radioChild. You can freely design the selected and unselected effects by combining with the value obtained from Radio's onchange event.
Note: Although Tailwind makes styling convenient, too much customization will defeat the purpose of using a component library.
To optimize the user experience, the entire area of RadioItem is clickable and will activate its corresponding value, not just the text or icon areas.
ActionSheet, Picker, and Radio all provide data for users to select or perform operations, but when should each component be used?