Skip to content

New feature: Support radio buttons with StandardFacet. #505

@damontgomery

Description

@damontgomery

We would like to display StandardFacet using radio buttons.

It would also be useful to be able to deselect / clear the options. This isn't something radio buttons typically allow with the basic HTML elements.

Example

We have range facets that are inclusive, such as rating or time,

3 or more, 4 or more, 5
next day, next week, next month

Current options

With the current StandardFacet, these are all displayed as checkboxes and we can select multiple values. This works, but is not intuitive since options like 3 or more include 4 or more.

For now, we have created our own components that mimic the StandardFacet component using the hooks directly.

However, when using Facets, we cannot order our custom facets between those rendered by the Facets component. So, we display them at the top or bottom next to the Facets component.

Aside about the current Facets component.

From what I gather, the Facets component uses its children as configuration and renders the 3 supported components itself. The order is maintained, but we can only use those 3 supported components. An alternative would be to export the provider and allow the application to place any component inside it that also uses the same hooks, etc. I understand there is a trade-off with the way the Facets component can also discover all the facets and render them itself. It would be nice if it wasn't an all-or-nothing since a lot of the components that already exist get us very far and work well.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions