mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-14 18:01:06 +00:00
19 lines
456 B
Svelte
19 lines
456 B
Svelte
<script lang="ts">
|
|
import { ComboBox } from "carbon-components-svelte";
|
|
|
|
function shouldFilterItem(item: { text: string }, value?: any) {
|
|
if (!value) return true;
|
|
return item.text.toLowerCase().includes(value.toLowerCase());
|
|
}
|
|
</script>
|
|
|
|
<ComboBox
|
|
titleText="Contact"
|
|
placeholder="Select contact method"
|
|
items={[
|
|
{ id: "0", text: "Slack" },
|
|
{ id: "1", text: "Email" },
|
|
{ id: "2", text: "Fax" },
|
|
]}
|
|
{shouldFilterItem}
|
|
/>
|