Smart Search Input
inovue-ui/smart-search-inputFreeComponent
An advanced search input component with filter tree, multi-select, and various input types.
Install it
npx shadcn@latest add https://raw.githubusercontent.com/smoosex/inovue-ui/main/public/r/smart-search-input.jsonSource
1<script setup lang="ts">2import { X } from "@lucide/vue";3import type { ActiveFilterItem } from "./types";4import { GetI18nText, type Locale } from "./locales";56const props = withDefaults(7 defineProps<{8 locale?: Locale;9 }>(),10 {11 locale: "en",12 },13);1415const filters = defineModel<ActiveFilterItem[]>("filters", { required: true });1617const emit = defineEmits<{18 (e: "remove", key: string): void;19 (e: "clear-all"): void;20}>();2122const $t = (key: Parameters<typeof GetI18nText>[0]) =>23 GetI18nText(key, props.locale);2425const handleRemove = (key: string) => {26 filters.value = filters.value.filter((f) => f.key !== key);27 emit("remove", key);28};2930const handleClearAll = () => {31 filters.value = [];32 emit("clear-all");33};34</script>3536<template>37 <div v-if="filters.length" class="flex flex-wrap gap-2 items-center">38 <span class="text-sm text-muted-foreground">{{ $t("filterTag") }}</span>39 <div40 v-for="item in filters"41 :key="item.key"42 class="flex items-center gap-1 px-2 py-1 text-sm bg-muted rounded-md"43 >44 <span class="truncate max-w-40"45 >{{ item.label }}: {{ item.displayValue }}</span46 >47 <button48 class="hover:bg-muted-foreground/20 rounded p-0.5"49 @click="handleRemove(item.key)"50 >51 <X class="h-3 w-3" />52 </button>53 </div>54 <button55 class="text-xs text-muted-foreground hover:text-foreground"56 @click="handleClearAll"57 >58 {{ $t("clearAll") }}59 </button>60 </div>61</template>
What it pulls in
npm packages
Other registry items
Files it writes
More from inovue-ui
All 4 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| Advanced Tableadvanced-table | inovue-ui | Components | Free | 3 deps · 6 files | |
| Date Time Range Pickerdate-time-range-picker | inovue-ui | Components | Free | 2 deps · 9 files | |
| Toolbartoolbar | inovue-ui | Components | Free | no deps · 4 files |
