RadioButton
RadioButton component from the UILaunch design system, ideal for single selections within a group.
🔘 RadioButton
The RadioButton component is used when you want users to select a single option from a list. It supports different sizes, variants, and can be displayed with labels on either side. Use RadioButton inside a RadioButtonStack to manage selection state and layout direction.
📦 Import
import RadioButton, { RadioButtonStack } from '@madefordevs1999/ui-launch-native/system/atoms/RadioButton';
🧩 Usage
import { Spacing } from '@madefordevs1999/ui-launch-native';
import Box from '@madefordevs1999/ui-launch-native/system/atoms/Box';
import RadioButton, { RadioButtonStack } from '@madefordevs1999/ui-launch-native/system/molecules/RadioButton';
const App = () => {
return (
<Box flex={1} justifyContent="center" alignItems="center">
<RadioButtonStack
defaultSelectedValue="option1"
direction="column"
space={Spacing.Spacing2}>
<RadioButton
value="rock"
title="Rock"
description="The hardest rock music"
/>
<RadioButton
value="pop"
title="Pop"
description="The most popular pop music"
/>
<RadioButton
value="jazz"
title="Jazz"
description="Just jazz"
disabled
/>
</RadioButtonStack>
</Box>
);
};
export default App;
Results
📜 RadioButton Props
Prop Name | Type | Default | Description |
---|---|---|---|
value | string | — | Valor que identifica este botón de radio. Requerido. |
title | string | — | Etiqueta principal del botón. |
description | string | — | Etiqueta secundaria opcional. |
disabled | boolean | false | Desactiva el botón. |
labelsSide | 'left' | 'right' | 'right' | Posición de las etiquetas con respecto al círculo del botón. |
onValueChange | (value: string) => void | — | Callback opcional cuando se selecciona este botón. |
fullWidth | boolean | false | Si el botón debe ocupar todo el ancho de su contenedor. |
variant | 'primary' | 'secondary' | 'primary' | Estilo visual del botón. |
size | 'small' | 'medium' | 'large' | 'medium' | Tamaño del botón y etiquetas. |
📜 RadioButtonStack Props
Prop Name | Type | Default | Description |
---|---|---|---|
defaultSelectedValue | string | "" | Valor seleccionado por defecto. |
direction | 'row' | 'column' | 'column' | Dirección del layout de los botones. |
space | Spacing | — | Espaciado entre los botones. |