pagefind icon indicating copy to clipboard operation
pagefind copied to clipboard

Sort ModularUI FilterPills

Open ColeDCrawford opened this issue 1 year ago • 2 comments

FilterPills can take an ordering array. How would one sort those based on the filter count, so the most used items appear at the top?

Is there a way to customize the display of the pills, for example making them into a more standard dropdown list?

ColeDCrawford avatar May 28 '24 23:05 ColeDCrawford

No trivial way to do the former, nothing exists in that component for the latter. But the goal of the Modular UI is that new cases can be addressed by creating new modules, rather than adding to existing modules.

Copying the filterPills.js file and making some tweaks would be the best step (until more "official" modules are added). Then your own class can be passed to the instance.add function of the Modular UI.

bglw avatar May 28 '24 23:05 bglw

(I'll look at adding an option for that sorting next time I'm in the file though, that's a good call)

bglw avatar May 28 '24 23:05 bglw