[blocks]: Filter Component for Ecommerce like Sidebar #7873
a95z
started this conversation in
Blocks Request
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Description
I would like to request a Filter Component Block for ecommerce pages, designed to work like a sidebar but built with Shadcn Canary and Tailwind CSS v4. This component should be reusable (similar to the Shadcn sidebar) and dynamically render filter groups from JSON.
Key Features & Functionalities
Dynamic Filter Groups
(e.g., Shoes (12)), where the count is smaller and muted.Price Range Slider
Slidercomponent.$10 – $200).Search Params Integration
searchParamsdynamically.price_minandprice_max.UI & UX Standards
overflow-y-autowith a fixed max height.Component API
groups: FilterGroup[]where each group can betype: "checkbox"ortype: "range".onChangecallback to propagate selected filters as an object.Checkbox,Label,ScrollArea, andSlider.Example JSON
[ { "id": "categories", "title": "Categories", "type": "checkbox", "items": [ { "label": "Shoes", "value": "shoes", "count": 12 }, { "label": "Bags", "value": "bags", "count": 5 }, { "label": "Watches", "value": "watches", "count": 8 } ] }, { "id": "brands", "title": "Brands", "type": "checkbox", "items": [ { "label": "Nike", "value": "nike", "count": 4 }, { "label": "Adidas", "value": "adidas", "count": 3 }, { "label": "Puma", "value": "puma", "count": 2 } ] }, { "id": "price", "title": "Price Range", "type": "range", "range": { "min": 0, "max": 500, "step": 10 } } ] ### Example _No response_Beta Was this translation helpful? Give feedback.
All reactions