Results Icon
The JavaScript Search Framework comes with a default set of icons. The prebuilt result templates take advantage of the Icon
component to output the corresponding icon for a given file type.
You can use custom icons instead of the default ones by creating a CSS class for each of your custom icons and referring to this class in the Icon
component.
Using Custom Icons
Add a CSS class for a custom icon in your search page HTML or in a CSS resource.
In the search page HTML, in the result template for which you want to change the icon, locate the element with the
CoveoIcon
class. Add thedata-value='<NAME>'
attribute, where you replace<NAME>
with the name of your custom icon CSS class.You can also use the
labelValue
option to set a tooltip on the icon by adding thedata-label-value='<LABEL>'
attribute, where you replace<LABEL>
with the desired label.
This preview shows page 114 - 119 out of 180 pages. Results System Behaviour Pass/Fail 1 Add Feedback Click on the add icon on the The record added to the database Connecting the database and execute Pass System Behaviour Pass/Fail 1 Add Feedback Click on the add icon on the The record added to the database Connecting the database and execute Pass. Icon pattern Create icon patterns for your wallpapers or social networks. Google Workspace. Icons for Slides & Docs +2.5 million of free customizable icons for your Slides, Docs and Sheets.
Some of the prebuilt templates use the small
option, which outputs a smaller version of the icon. When adding your own icon, you may want to add the data-small='false'
attribute to ensure the option is disabled.
Example Use Case
You want your Atlassian Jira Software Cloud source results to include the Jira Software icon. You create a CSS class for a background image referring to the www.atlassian.com/software/jira favicon. The default icons are 60px by 60px in size.
In the Jira Software Cloud result template, you add the data-value='icon-jira'
attribute to the element with the CoveoIcon
class.
Please, Do not forget to link to RESULTS ICON page for attribution!
Thanks for choosing us!