Components/FlatRadio
Since 2.4.7BETA

FlatRadio

Inline flat selector for 2-5 options (`TxFlatRadio` + `TxFlatRadioItem`). Provides sliding indicator animation, keyboard navigation, and full TypeScript support.

This page was migrated by AI, please review carefully

Migration is complete, but please validate against source code and manual review.

FlatRadio

Inline flat selector for 2-5 options (TxFlatRadio + TxFlatRadioItem). More direct than dropdown selectors, more compact than Radio.

Basic Usage

The simplest flat selector, ideal for a small number of options.

FlatRadio (basic)

Demo loads on client.

Sizes

Supports sm, md (default), and lg sizes.

FlatRadio (sizes)

Demo loads on client.

Icons

Use the icon prop to add icons to options (CSS class, e.g. UnoCSS icons).

FlatRadio (icon)

Demo loads on client.

Disabled State

Supports both group-level and item-level disabling.

FlatRadio (disabled)

Demo loads on client.

Bordered

Set the bordered prop to add an outer border.

FlatRadio (bordered)

Demo loads on client.

Keyboard Navigation

When the container is focused:

KeyBehavior
/ Select next non-disabled item (wraps)
/ Select previous non-disabled item (wraps)
HomeSelect first non-disabled item
EndSelect last non-disabled item

API

TxFlatRadio

Props

PropDescriptionTypeDefault
modelValue / v-modelBound valuestring | number-
disabledDisable entire groupbooleanfalse
sizeSize variant'sm' | 'md' | 'lg''md'
borderedShow outer borderbooleanfalse

Events

EventDescriptionParams
update:modelValueEmitted when value updates(value: string | number) => void
changeEmitted when value changes(value: string | number) => void

Slots

SlotDescription
defaultTxFlatRadioItem children

TxFlatRadioItem

Props

PropDescriptionTypeDefault
valueItem valuestring | number-
labelDisplay textstring-
iconIcon CSS classstring-
disabledDisable this itembooleanfalse

Slots

SlotDescription
defaultCustom content (overrides label)
iconCustom icon
Was this helpful?