Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Adding Image to the label #65

Open
lelisloisBen opened this issue Jan 17, 2020 · 1 comment
Open

Adding Image to the label #65

lelisloisBen opened this issue Jan 17, 2020 · 1 comment

Comments

@lelisloisBen
Copy link

Hi, I'm trying to add an image in front of each option, my array of options look like that:

const icons = [
{ img: mbaltimeter, label: "altimeter", value: "altimeter" },
{ img: mbball, label: "ball", value: "ball" },
{ img: mbbatton, label: "batton", value: "batton" },
{ img: mbbike, label: "bike", value: "bike" },
]

as you can see I have Img holding the variable that imports the image path, the label and the value.
How can I show the image in each option in front of the label?

Thank you.

@v-honcharenko
Copy link

Hi @samirbenzada

You can achieve it using ItemRenderer prop. Check the examples in the storybook and here.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants