Filter #197
Replies: 8 comments
-
Hi, this pattern is ideal for a Home Office project I've been working on. I'm finishing up soon but I'll let some other designers know, along with the developers in my team. |
Beta Was this translation helpful? Give feedback.
-
Issue created to add to the Pattern Library: #231 |
Beta Was this translation helpful? Give feedback.
-
PR for adding to the Pattern Library: #230 |
Beta Was this translation helpful? Give feedback.
-
Request for showing an example of filters being used with a sortable table at the same time. |
Beta Was this translation helpful? Give feedback.
-
Hi there, Our service (Court and Tribunal Hearings within HMCTS) recently went through the Accessibility Audit process from the Digital Accessibility Centre (DAC). We use the nunjucks version of the component within an alphabetical search page. We received the following feedback on the filter component: "Users are presented with the ‘Selected filter’ section and the ‘Apply filters’ button and ‘Clear filters’ links above the filter selection checkboxes, this means that users have to navigate through the filter sections to make a selection and navigate back through the checkboxes to apply the filter selection. " We thought it might assist other teams who decide to use this component to pre-warn them about this. It is of course possible to reorder the display of the component by manipulating the raw HTML but the default implementation is likely to receive a similar response from DAC audits. Please let me know if I can clarify anything. |
Beta Was this translation helpful? Give feedback.
-
In OPG we've had to write custom JavaScript to modify this component to allow us to overrule the default open/close state of the filters. We wanted the filters to be hidden by default, and only shown when either the button is clicked or the user already has filters selected (e.g. on reload or back button) (see PR). I think this is particularly important for apps that handle filters/pagination on the server-side, so that they can provide a consistent UI. |
Beta Was this translation helpful? Give feedback.
-
Ticket numberThe details below is pulled from the ticket. SummaryThe Filter component should provide a way of specifying custom classes. MotivationMost (all?) other components offer the ability to add extra classes by providing a The Filter component is currently missing this feature. Describe alternatives you've consideredAt the moment, it seems the only way to tweak the styling of this component is to override the default styles: App css:.moj-filter__header {
background: govuk-colour("light-grey");
} When allowing extra classes, the modifier could be used to ensure original styles are not touched: Template:
.moj-filter--light-header .moj-filter__header {
background: govuk-colour("light-grey");
} Additional contextHappy to provide the PR for this! |
Beta Was this translation helpful? Give feedback.
-
Ticket number#616. The details below is pulled from the ticket. SummarySimilar to this issue, the Apply Filters button in the Filter component should be able to have custom classes applied to it. MotivationMost other components offer the ability to add extra classes by providing a classes parameter when instantiating including the govUkButton component which is being used under the hood in the moj filter component. This is useful for extending styling without overwriting default implementation (for instance, by providing a modifier class to create a bespoke theme). The Filter component does not allow a custom button class to be passed through to the govUkButton component used to apply the filter. Describe alternatives you've consideredAt the moment, it seems the only way would be to tweak the styling of the gov uk button on the page it is used: App css:.govuk-button {
custom styles
} which is very undesirable as it would affect all buttons on the page and could be hidden from future developers working on the page. Otherwise we would have to avoid using nunjucks and simply write the HTML with custom classes ourselves. Additional contextHappy to provide the PR for this! |
Beta Was this translation helpful? Give feedback.
-
Existing
Components and patterns
GitHub discussions
New generic filter guidance
Do user research to find out the best order for the filters.
Variation
Product created in
OPG Sirius Supervision workflow
About the product
OPG Sirius Supervision workflow is a product being developed in OPG to replace its legacy system.
Who the users are
It will be used by staff of the OPG to allow them to supervise deputies appointed by the court of protection.
User need
There is a need for users to be able to filter lists of information in order to manage their work. There are many filters and options users need to filter by. Users are unlikely to select more than one filter at a time.
Using the existing filter component
Before designing a variation, the team first followed the guidance of the filter component and Filter a list pattern in the MOJ Pattern Library.
Research showed:
Designing a variation
The team used their research and the Option select component from the Finder Frontend Component Guide as a reference to design a variation of the filter component that would meet the user need.
This variation:
Research on this variation
This variation has been tested with users and iterated and improved based on research.
Is it useful and unique?
When to use
How to use
Find out how your users interact with the content
Users might need the filters they have opened to stay open if they leave and then return to the page. You can configure the filters to stay open.
Use clear labels
Hiding filters hides the options, so the labels need to be clear. If necessary, you can add a summary line to help users understand what is in the filter.
If you struggle to come up with clear labels, it might be because the way you’ve separated the content is not clear.
Contribute
Things we don’t know enough about
Accessibility testing
Once we have a production version ready of this variation we will conduct accessibility testing.
Users don’t always see that there is a filter
Should we:
Selected filters can't be seen when filters is hidden
Should we:
Beta Was this translation helpful? Give feedback.
All reactions