For vue2 projects, use @94ai/common-ui
LLMs.md

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 ​

Loading example…
Single and multiple selection

Sizes ​

Loading example…
Sizes

Disabled states ​

Loading example…
Disabled states

Custom tooltips ​

Loading example…
Custom tooltips

Interactive example ​

value: 2; changes: 0; last:

Installation ​

ts
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 ​

ts
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.

ParameterDescriptionTypeOptionsDefault
groupsOption list with name, value, disabled and tip; business text is not translated automatically.RadioGroupOption[]—[]
valueCurrent value: string/number for single selection, array for multiple; supports v-model:value.RadioGroupModelValue—''
modelValueCurrent value; Vue 3 v-model takes precedence over the compatibility prop.RadioGroupModelValue—undefined
multipleEnable multiple selection; use an array for multiple values.boolean—false
disabledWhether to disable the component.boolean—false
sizeOption size.stringsmall / medium / large'medium'
placementPopup placement.stringtop / top-start / top-end / bottom / bottom-start / bottom-end / left / left-start / left-end / right / right-start / right-end'top'
effectTooltip theme.stringdark / light'dark'
offsetPopup offset in pixels.number—0
transitionPopup transition name.string—'el-fade-in-linear'
visibleArrowWhether to show the popup arrow.boolean—true
popperOptionsPopper 2 options; use modifiers to customize positioning.RadioGroupPopperOptions—{ boundariesElement: 'body', gpuAcceleration: false }
popperClassCustom class for the popup.string—''
openDelayShow delay for hover, in milliseconds.number—0
enterableWhether the pointer can enter the Tooltip.boolean—true
hideAfterTooltip auto-close delay after showing, in milliseconds; 0 disables auto-close.number—0
tabindextabindex of the trigger.number—0

Events ​

EventDescriptionPayload
update:valueUpdate the bound value.(value: RadioGroupModelValue)
update:modelValueUpdate the bound value.(value: RadioGroupModelValue)
changeFires when an option is clicked; value is the operated option, not the whole multiple-selection array.({ index: number, value: string | number })

Slots ​

ParameterDescriptionPayload
contentCustom 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.