Use label
prop to set the label.
<script lang="ts" setup>
import { ref } from 'vue'
const favoriteFruit = ref(null)
</script>
<template>
<div class="flex flex-col gap-y-3 mt-6">
<ARadio
v-model="favoriteFruit"
name="fruit"
value="banana"
label="Banana"
/>
<ARadio
v-model="favoriteFruit"
name="fruit"
value="apple"
label="Apple"
/>
<ARadio
v-model="favoriteFruit"
name="fruit"
value="mango"
label="Mango"
/>
<ARadio
v-model="favoriteFruit"
name="fruit"
value="orange"
label="Orange"
disabled
/>
<small>Selected: {{ favoriteFruit }}</small>
</div>
</template>
Use color
prop to change the radio color.
<script lang="ts" setup>
import { defaultThemeColors } from 'anu-vue'
import { ref } from 'vue'
const favoriteFruit = ref()
</script>
<template>
<div class="flex flex-col gap-y-3 mt-6">
<ARadio
v-for="color in defaultThemeColors"
:key="color"
v-model="favoriteFruit"
name="radio-color"
:color="color"
:value="color"
:label="color"
class="capitalize"
/>
</div>
</template>
Radio color
Disable radio
Bind v-model value to radio
Bind classes to input element
Define label text
Default slot for rendering radio label. If default slot is used label
prop will be discarded.