Skip to content

FxIconSelect

Icon selector component with search, pagination, and multi-tab switching.

Basic Usage

vue
<template>
  <FxIconSelect v-model="iconName" placeholder="Select an icon" />
</template>

<script setup>
import { ref } from 'vue'
const iconName = ref('')
</script>

Auto Preset Detection

FxIconSelect automatically detects the installed UI framework and loads the corresponding preset:

UI FrameworkDetection MethodPreset Component
Element PlusDetects ElPopover global componentElement Plus style selector
Naive UIDetects NPopover global componentNaive UI style selector
AntDv NextDetects APopover global componentAntDv Next style selector
TDesignDetects TPopup global componentTDesign style selector

After installing a UI framework, the selector automatically uses the corresponding preset without configuration.

Props

PropTypeDefaultDescription
modelValuestringv-model bound icon name
placeholderstring'请选择图标'Placeholder text
heightnumber418Popover height (px)

Events

EventParametersDescription
update:modelValue(value: string)Emitted when an icon is selected

Headless Usage

If you don't use a preset component, you can customize the selector UI via the useIconSelect composable:

vue
<template>
  <FxIconSelect v-model="iconName">
    <template #default="{ visible, tabs, handleInputClick, handleSelectIcon }">
      <!-- Custom selector UI -->
    </template>
  </FxIconSelect>
</template>

See useIconSelect for details.

Examples

Basic

vue
<template>
  <FxIconSelect v-model="iconName" />
  <p>Selected: {{ iconName }}</p>
</template>

Custom Height and Placeholder

vue
<template>
  <FxIconSelect
    v-model="iconName"
    placeholder="Click to select an icon"
    :height="500"
  />
</template>