Files
heroui-vue/apps/docs/demos/select-with-clear-button.vue

53 lines
1.3 KiB
Vue

<script setup lang="ts">
import {
Select,
SelectTrigger,
SelectValue,
SelectIndicator,
SelectClearButton,
SelectPopover,
ListBox,
ListBoxItem,
ListBoxItemIndicator,
Label,
} from "@heroui-vue/components";
</script>
<template>
<Select class="w-[256px]" default-value="california" placeholder="Select one">
<Label>State</Label>
<SelectTrigger>
<SelectValue />
<SelectClearButton />
<SelectIndicator />
</SelectTrigger>
<SelectPopover>
<ListBox>
<ListBoxItem id="florida" text-value="Florida">
Florida
<ListBoxItemIndicator />
</ListBoxItem>
<ListBoxItem id="delaware" text-value="Delaware">
Delaware
<ListBoxItemIndicator />
</ListBoxItem>
<ListBoxItem id="california" text-value="California">
California
<ListBoxItemIndicator />
</ListBoxItem>
<ListBoxItem id="texas" text-value="Texas">
Texas
<ListBoxItemIndicator />
</ListBoxItem>
<ListBoxItem id="new-york" text-value="New York">
New York
<ListBoxItemIndicator />
</ListBoxItem>
<ListBoxItem id="washington" text-value="Washington">
Washington
<ListBoxItemIndicator />
</ListBoxItem>
</ListBox>
</SelectPopover>
</Select>
</template>