Tagged “naming”
Design Systems should avoid “God components” and Swiss Army Knives
Something we often talk about in our Design System team is that components should not be like Swiss Army Knives. It’s better for them to be laser-focused because by limiting their scope to a single task they are more reusable and support a more extensible system through composition.
Discussions often arise when we consider the flip-side – components which do too much, know too much, or care too much! When they cover too much ground or make assumptions about their context, things go wrong. Here are some examples.
Card
In websites where many elements have a “rounded panel”-like appearance so as to pop off the background, you can run into problems. Because of the somewhat Card-like appearance, people start to regard many semantically distinct things as “Cards” (rather than limiting the meaning of Card to a more conventional definition). Here are some of the problems this can cause:
- If the name covers a million use cases, then how can you describe it sensibly, or define its boundaries?
- When do you stop piling on different things it can mean? How do you stop it growing? How do you avoid bloat?
- Ongoing naming/confusion issues: you’re setting yourself up for continued confusion and code disparity. If something is “semantically” a note, or a comment, or a message etc then you can expect that future staff are gonna describe it as that rather than a Card! They’ll likely (understandably) write code that feels appropriate too. The problem will continue.
I appreciate that often we need pragmatic solutions, so if our designs have lots of similar-looking elements then there is still something we can do. If the repeated thing is more of a “shape” than a something with common-purpose, then just call it out as that! That could either be by name – for example Every Layout have a Box layout which could be a starting point – or by categorisation i.e. by moving the non-ideally named thing into a clearly demarcated Utilities (or similar) category in your Design System.
Flex
It seems that a number of Design Systems have a Flex component. My feeling, though, is that these represent an early reaction to the emergence of CSS’s Flexbox, rather than necessarily being sensible system-friendly or consumer-friendly components. CSS layout covers a lot and I think breaking this down into different smaller tools (Stack, Inline, Grid etc) works better.
Button
I’ve talked before about the “Everything is a button” mindset and how it’s harmful. Buttons and links are fundamentally different HTML elements with totally different purposes, and bundling them together has various ill effects that I see on a regular basis.
References
The Component Gallery
The component gallery is an up-to-date list of interface component examples. It’s really helpful for looking up existing naming conventions. It also contains a list of Design Systems.
Nordhealth’s Design System
There’s so much to admire in Nord Health’s Design System and specifically its reference website.
I love the way it looks and is organised.
There’s a fantastic, practical accessibility checklist.
They document their naming conventions and the rationale behind them.
They were a trailblazer in adopting web components and I love the docs explaining why.
We’ve chosen to use Web Components because there is a strong requirement for Nord to be used in many different contexts and with varying technologies — from static HTML pages to server-rendered apps, through to single page applications authored with frameworks such as React and Vue. Web Components work great for Nord, because they:
- Are tech-agnostic instead of tech-specific
- Future proof our system with Web Standards
- Allow us to use any framework or no framework at all
- Provide great encapsulation for styles and functionality
Lastly their components look great and show a really high-level of front-end and accessibility literacy.
BEM Naming Cheat Sheet by 9elements
Here’s a handy resource providing BEM-based naming suggestions for some of the most common web components.
It includes sensible BEM naming for such common components as:
- Breadcrumb;
- Button;
- Card;
- Navigation;
- Tabs; and
- Stack.
Newspaper Terminology (from The Guardian)
The web and print are different media, however I still find some of print’s time-honoured terminology useful for naming things.
For example I use standfirst to identify intro paragraphs on Greenhill Journal Entries. This Guardian resource is a useful reference.
See all tags.