From a639b8f513679191acab47664f14ef5c176c8c2a Mon Sep 17 00:00:00 2001 From: Eric Liu Date: Sat, 19 Mar 2022 08:37:10 -0700 Subject: [PATCH] docs(combo-box): add "Custom slot" example --- docs/src/pages/components/ComboBox.svx | 6 ++++ .../pages/framed/ComboBox/ComboBoxSlot.svelte | 29 +++++++++++++++++++ 2 files changed, 35 insertions(+) create mode 100644 docs/src/pages/framed/ComboBox/ComboBoxSlot.svelte diff --git a/docs/src/pages/components/ComboBox.svx b/docs/src/pages/components/ComboBox.svx index b5d11af5..d934e11f 100644 --- a/docs/src/pages/components/ComboBox.svx +++ b/docs/src/pages/components/ComboBox.svx @@ -18,6 +18,12 @@ items={[ {id: "2", text: "Fax"} ]} /> +### Custom slot + +Override the default slot to customize the display of each item. Access the item and index through the `let:` directive. + + + ### Selected id + import { ComboBox } from "carbon-components-svelte"; + + + +
+ {item.text} +
+
+ id: {item.id} - index: + {index} +
+
+ +