Radio group
A segmented button selector using Element Plus Tooltip, with single/multiple selection, three sizes and disabled states. Labels and hints are supplied by the application; use the header to switch component themes.
Single and multiple selection
Sizes
Disabled states
Custom tooltips
Interactive example
Installation
import NfRadioGroup from '@94ai-plus/nf-radio-group'
import 'element-plus/dist/index.css'
import '@94ai-plus/nf-theme-chalk/nf-radio-group.css'
app.use(NfRadioGroup)Types
import type { RadioGroupOption, RadioGroupModelValue, RadioGroupChange } from '@94ai-plus/nf-radio-group'
// RadioGroupOption: { name: string; value: string | number; tip?: string; disabled?: boolean }
// RadioGroupModelValue: string | number | (string | number)[]
// RadioGroupChange: { index: number; value: string | number }Props
Text props follow the library language when omitted; defaults below use this language.
| Parameter | Description | Type | Options | Default |
|---|---|---|---|---|
groups | Option list with name, value, disabled and tip; business text is not translated automatically. | RadioGroupOption[] | — | [] |
value | Current value: string/number for single selection, array for multiple; supports v-model:value. | RadioGroupModelValue | — | '' |
modelValue | Current value; Vue 3 v-model takes precedence over the compatibility prop. | RadioGroupModelValue | — | undefined |
multiple | Enable multiple selection; use an array for multiple values. | boolean | — | false |
disabled | Whether to disable the component. | boolean | — | false |
size | Option size. | string | small / medium / large | 'medium' |
placement | Popup placement. | string | top / top-start / top-end / bottom / bottom-start / bottom-end / left / left-start / left-end / right / right-start / right-end | 'top' |
effect | Tooltip theme. | string | dark / light | 'dark' |
offset | Popup offset in pixels. | number | — | 0 |
transition | Popup transition name. | string | — | 'el-fade-in-linear' |
visibleArrow | Whether to show the popup arrow. | boolean | — | true |
popperOptions | Popper 2 options; use modifiers to customize positioning. | RadioGroupPopperOptions | — | { boundariesElement: 'body', gpuAcceleration: false } |
popperClass | Custom class for the popup. | string | — | '' |
openDelay | Show delay for hover, in milliseconds. | number | — | 0 |
enterable | Whether the pointer can enter the Tooltip. | boolean | — | true |
hideAfter | Tooltip auto-close delay after showing, in milliseconds; 0 disables auto-close. | number | — | 0 |
tabindex | tabindex of the trigger. | number | — | 0 |
Events
| Event | Description | Payload |
|---|---|---|
update:value | Update the bound value. | (value: RadioGroupModelValue) |
update:modelValue | Update the bound value. | (value: RadioGroupModelValue) |
change | Fires when an option is clicked; value is the operated option, not the whole multiple-selection array. | ({ index: number, value: string | number }) |
Slots
| Parameter | Description | Payload |
|---|---|---|
content | Custom Tooltip content; only shown when tip exists and the option is enabled. | { item: RadioGroupOption, index: number } |
Migration notes
Replace Vue 2 :value.sync with v-model:value. Default v-model is also supported; modelValue wins when both are supplied. Multiple selection requires an array. Inputs are not mutated; current values are filtered in group order before toggling. Clicking the selected single item emits nothing. The change payload always contains the clicked item value.
Legacy openDelay/visibleArrow map to showAfter/showArrow. Legacy hideAfter retains auto-close semantics via autoClose, starting when shown. The mouseleave delay is 200ms; enterable controls pointer entry. Legacy boundariesElement/gpuAcceleration become Popper 2 modifiers. Rewrite other Popper 1 settings for Popper 2; explicit modern modifiers win.
Disabled items can no longer be selected. Non-array multiple values no longer throw or match string substrings. Native buttons support Enter/Space, arrows and Home/End, skipping disabled items. Arrows select in single mode and only focus in multiple mode. Missing tips or disabled items/groups suppress tooltips even with a content slot. The slot now receives item/index. Business text is not auto-translated.
