Migrating from ghl-ui RadioGroup to HighRise RadioGroup
This guide will help you migrate from the ghl-ui RadioGroup component to the new HighRise RadioGroup component.
Component Implementation Changes
Import Changes
diff
- import { UIRadioGroup, UIRadio } from '@gohighlevel/ghl-ui'
+ import { HLRadioGroup, HLRadio } from '@platform-ui/highrise'Basic Usage Changes
diff
- <UIRadioGroup
- v-model="selectedValue"
- >
- <UIRadio value="1">Option 1</UIRadio>
- <UIRadio value="2">Option 2</UIRadio>
- <UIRadio value="3">Option 3</UIRadio>
- </UIRadioGroup>
+ <HLRadioGroup
+ id="radio-group"
+ v-model:value="selectedValue"
+ >
+ <HLRadio value="1">Option 1</HLRadio>
+ <HLRadio value="2">Option 2</HLRadio>
+ <HLRadio value="3">Option 3</HLRadio>
+ </HLRadioGroup>Form Integration Changes
diff
- <UIForm :model="formModel">
- <UIFormItem label="Gender">
- <UIRadioGroup
- v-model="formModel.gender"
- >
- <UIRadio value="male">Male</UIRadio>
- <UIRadio value="female">Female</UIRadio>
- <UIRadio value="other">Other</UIRadio>
- </UIRadioGroup>
- </UIFormItem>
- </UIForm>
+ <HLForm :model="formModel" :rules="rules">
+ <HLFormItem
+ label="Gender"
+ path="gender"
+ required
+ >
+ <HLRadioGroup
+ id="gender-group"
+ v-model:value="formModel.gender"
+ >
+ <HLRadio value="male">Male</HLRadio>
+ <HLRadio value="female">Female</HLRadio>
+ <HLRadio value="other">Other</HLRadio>
+ </HLRadioGroup>
+ </HLFormItem>
+ </HLForm>Props Changes
| ghl-ui Prop | HighRise Prop | Notes |
|---|---|---|
v-model | v-model:value | Uses value prop with update:value event |
size | size | Size tokens change to sm | md | lg (inherits hr-form size when present) |
name | - | Not supported; rely on id + group semantics |
| - | id | Required for accessibility |
| - | width | 'default' | 'equal' | 'full'; controls item layout and wrapping |
| - | theme | 'primary' | 'neutral'; sets selection theming |
| - | radioCardGroup | Enables radio-card specific styling when grouping HLRadioCard children |
Examples
Basic RadioGroup
vue
<template>
<HLRadioGroup id="basic-group" v-model:value="selectedValue">
<HLRadio value="1">Option 1</HLRadio>
<HLRadio value="2">Option 2</HLRadio>
<HLRadio value="3">Option 3</HLRadio>
</HLRadioGroup>
</template>
<script setup>
import { ref } from 'vue'
import { HLRadioGroup, HLRadio } from '@platform-ui/highrise'
const selectedValue = ref('')
</script>RadioGroup with Equal Width Layout
vue
<template>
<HLForm :model="formModel">
<HLFormItem label="Subscription" path="plan" required>
<HLRadioGroup id="plan-group" v-model:value="formModel.plan" width="equal">
<HLRadio value="monthly">Monthly</HLRadio>
<HLRadio value="yearly">Yearly</HLRadio>
<HLRadio value="lifetime">Lifetime</HLRadio>
</HLRadioGroup>
</HLFormItem>
</HLForm>
</template>
<script setup>
import { ref } from 'vue'
import { HLForm, HLFormItem, HLRadioGroup, HLRadio } from '@platform-ui/highrise'
const formModel = ref({
plan: '',
})
</script>RadioGroup with Custom Layout
vue
<template>
<HLForm :model="formModel">
<HLFormItem label="Payment Method" path="paymentMethod">
<div class="grid grid-cols-2 gap-4">
<HLRadioGroup id="payment-group" v-model:value="formModel.paymentMethod">
<HLRadio value="credit">Credit Card</HLRadio>
<HLRadio value="debit">Debit Card</HLRadio>
<HLRadio value="paypal">PayPal</HLRadio>
<HLRadio value="bank">Bank Transfer</HLRadio>
</HLRadioGroup>
</div>
</HLFormItem>
</HLForm>
</template>
<script setup>
import { ref } from 'vue'
import { HLForm, HLFormItem, HLRadioGroup, HLRadio } from '@platform-ui/highrise'
const formModel = ref({
paymentMethod: '',
})
</script>RadioGroup with Disabled Options
vue
<template>
<HLForm :model="formModel">
<HLFormItem label="Subscription" path="subscription">
<HLRadioGroup id="subscription-group" v-model:value="formModel.subscription">
<HLRadio value="free">Free Plan</HLRadio>
<HLRadio value="basic">Basic Plan</HLRadio>
<HLRadio value="premium" disabled>Premium Plan (Coming Soon)</HLRadio>
</HLRadioGroup>
</HLFormItem>
</HLForm>
</template>
<script setup>
import { ref } from 'vue'
import { HLForm, HLFormItem, HLRadioGroup, HLRadio } from '@platform-ui/highrise'
const formModel = ref({
subscription: '',
})
</script>Best Practices
- Always provide a unique
idfor accessibility - Use
v-model:valuefor two-way binding - Implement proper form validation
- Use appropriate size variants
- Consider mobile responsiveness
- Add proper ARIA labels
- Handle loading states appropriately
- Use descriptive labels
- Group related options logically
- Use consistent spacing and alignment
- Implement proper error handling
- Consider using tooltips for additional information
- Handle disabled states properly
- Use appropriate layout for different screen sizes
Additional Notes
- The component automatically handles focus states
- Error states are managed through validation status
- Supports keyboard navigation
- Maintains consistent styling with other form components
- Handles disabled states consistently
- Integrates seamlessly with form validation
- Maintains accessibility standards
- Supports custom styling through CSS variables
- Provides clear visual feedback for all states
- Works well on both desktop and mobile devices
- Supports both controlled and uncontrolled modes
- Includes built-in validation support