Pass extra attributes to items of the AisRefinementList component

Hi, we are using faceting with AisRefinementList components and we’d like to sort the options with a custom attribute and not with one of the default options like name:asc, name:desc etc

Unfortunately, each item provides certain predefined keys when used in AisRefinementList. Is there a way to pass sth extra apart from value, label, count and isRefined as specified in the docs here =>

Thanks a lot!!

Hi @carespot,

In the same ais-refinement-list widget you can still leverage the :sort-by attribute. It receives all the items and takes a function. In your case because you do not have the existing attribute/value to sort on, create a custom function to sort your items as you see fit on the front end.