From 26276395e33c6a04aaf079d63722c4f187a741dd Mon Sep 17 00:00:00 2001 From: Eric Liu Date: Thu, 29 Oct 2020 17:42:27 -0700 Subject: [PATCH] docs(dropdown): add example "Format item display text" --- docs/src/pages/components/Dropdown.svx | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/docs/src/pages/components/Dropdown.svx b/docs/src/pages/components/Dropdown.svx index a027819b..31c7d45f 100644 --- a/docs/src/pages/components/Dropdown.svx +++ b/docs/src/pages/components/Dropdown.svx @@ -13,6 +13,16 @@ components: ["Dropdown", "DropdownSkeleton"] {id: "1", text: "Email"}, {id: "2", text: "Fax"}]}" /> +### Format item display text + +Use the `itemToString` prop to format the display of individual items. + + { + return item.text + ' (' + item.id +')' +}} titleText="Contact" selectedIndex={0} items="{[{id: "0", text: "Slack"}, + {id: "1", text: "Email"}, + {id: "2", text: "Fax"}]}" /> + ### Light variant