Category / Section
How to design Dropdown filter with images
Published:
A combo box widget enables users to select a predefined value in the dropdown list. We can customize the dropdown list item with images, and it can be used to make selecting an option easier and more visually appealing. For example, a website may use a dropdown filter with images to allow users to select a product from a list of products, each represented by an image.
The following are steps to achieve the requirement "Dropdown Filter with images":
Step 1: Prepare a sample data source with fields such as an image and an equivalent value field.
NOTE: We can set the image source as a base64 string or a URL link.
Step 2: Configure the datasource in BoldBI.
Step 3: Use the CONCAT function to create a template expression with an image field as follows:
CONCAT('<div style="float: left;margin-right: 10px;"><img src=', [Image URL], ' alt=', [Social Media], ' style="width:20px;height: 18px;"></div>', [Social Media])
Step 4: Bind the field to the filter widget as follows.
Step 4: You can see the dropdown list rendered with images.