diff --git a/docs/src/examples/modules/Dropdown/Types/DropdownExampleSearchSelectionIcon.js b/docs/src/examples/modules/Dropdown/Types/DropdownExampleSearchSelectionIcon.js new file mode 100644 index 0000000000..c447b22ab6 --- /dev/null +++ b/docs/src/examples/modules/Dropdown/Types/DropdownExampleSearchSelectionIcon.js @@ -0,0 +1,20 @@ +import React from 'react' +import { Dropdown } from 'semantic-ui-react' + +const packageManagersOptions = [ + { key: 'gem', value: 'gem', icon: 'gem', text: 'RubyGems' }, + { key: 'npm', value: 'npm', icon: 'npm', text: 'NPM' }, + { key: 'docker', value: 'docker', icon: 'docker', text: 'Docker' }, +] + +const DropdownExampleSearchSelection = () => ( + +) + +export default DropdownExampleSearchSelection diff --git a/docs/src/examples/modules/Dropdown/Types/index.js b/docs/src/examples/modules/Dropdown/Types/index.js index 95a324878d..ff540f0f10 100644 --- a/docs/src/examples/modules/Dropdown/Types/index.js +++ b/docs/src/examples/modules/Dropdown/Types/index.js @@ -26,7 +26,14 @@ const DropdownTypesExamples = () => ( description='A selection dropdown can allow a user to search through a large list of choices.' examplePath='modules/Dropdown/Types/DropdownExampleSearchSelection' /> - + + {/* Possibly add state selection example. */} options ? options.map((option) => _.pick(option, ['key', 'value'])) : options function renderItemContent(item) { - const { flag, image, text } = item + const { flag, image, icon, text } = item // TODO: remove this in v3 // This maintains compatibility with Shorthand API in v1 as this might be called in "Label.create()" @@ -52,6 +52,7 @@ function renderItemContent(item) { <> {Flag.create(flag)} {Image.create(image)} + {Icon.create(icon)} {text}