Components/FlatSelect
Since 2.4.7BETA

FlatSelect

ComboBox-style dropdown selector (`TxFlatSelect` + `TxFlatSelectItem`). Options overlay the trigger, selected item anchors at trigger position, smooth clip-path expand/collapse animation.

This page was migrated by AI, please review carefully

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

FlatSelect

ComboBox-style dropdown selector (TxFlatSelect + TxFlatSelectItem). When clicked, the options list overlays the trigger with the selected item anchored at the trigger position. Uses clip-path for smooth expand/collapse animation.

Basic Usage

Click the trigger — the dropdown expands outward from the selected item position. The selected item displays a checkmark.

FlatSelect (basic)

Demo will load when visible.
<script setup lang="ts">
import { ref } from 'vue'

const value = ref('json')
</script>

<template>
  <TxFlatSelect v-model="value" placeholder="Select format">
    <TxFlatSelectItem value="json" label="JSON" />
    <TxFlatSelectItem value="csv" label="CSV" />
    <TxFlatSelectItem value="xml" label="XML" />
  </TxFlatSelect>
</template>

Disabled State

Supports both group-level and item-level disabling.

FlatSelect (disabled)

Demo will load when visible.
<script setup lang="ts">
import { ref } from 'vue'

const value = ref('')
</script>

<template>
  <!-- Group disabled -->
  <TxFlatSelect v-model="value" placeholder="Select" disabled>
    <TxFlatSelectItem value="a" label="Option A" />
    <TxFlatSelectItem value="b" label="Option B" />
  </TxFlatSelect>

  <!-- Item disabled -->
  <TxFlatSelect v-model="value" placeholder="Select">
    <TxFlatSelectItem value="a" label="Option A" />
    <TxFlatSelectItem value="b" label="Option B" disabled />
    <TxFlatSelectItem value="c" label="Option C" />
  </TxFlatSelect>
</template>

Interaction Contract

TxFlatSelect exposes the trigger as a combobox and the dropdown as a listbox. Items expose option selection state, disabled items cannot be selected, and ArrowUp/ArrowDown navigation skips disabled options while the dropdown is open.

Comparison with TxSelect

FeatureTxSelectTxFlatSelect
Positioningfloating-ui (Teleport to body)CSS absolute + clip-path
Expand effectDropdown appears below triggerComboBox: options overlay trigger, expand from selected item
AnimationNone (avoids scroll lag)Smooth clip-path expand/collapse
SearchSupportedNot supported
Use caseGeneral purpose, complex formsSettings pages, simple dropdowns
TriggerInput-style with iconButton-style with arrow

API

TxFlatSelect

Props

PropDescriptionTypeDefault
modelValue / v-modelBound valuestring | number''
placeholderPlaceholder textstring''
disabledDisable the selectorbooleanfalse

Events

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

Slots

SlotDescription
defaultTxFlatSelectItem children

TxFlatSelectItem

Props

PropDescriptionTypeDefault
valueItem valuestring | number-
labelDisplay textstring-
disabledDisable this itembooleanfalse

Slots

SlotDescription
defaultCustom content (overrides label)