Clarity Design System
Clarity is an open source design system that brings together UX guidelines, design resources, and coding implementations with Web Components. This repository includes everything you need to build, customize, test, and deploy Clarity. For complete documentation, visit the Clarity website.
If you are looking for Clarity Angular, our previous implementation of Clarity built in Angular, please see the angular
branch for the latest version there.
Getting Started
Clarity is published as five npm packages:
Contains the Web Components that work in any JavaScript framework.
Contains shims for core usage in Angular environment
Contains shims for core usage in React environment
Our open source sans-serif typeface.
Installing Clarity
Visit our documentation at https://clarity.design/get-started/
Documentation
For documentation on the Clarity Design System, including a list of components and example usage, see our website.
Contributing
The Clarity project team welcomes contributions from the community. For more detailed information, see our contribution guidances.
Licenses
- The Clarity Design System is licensed under the MIT license.
Feedback
If you find a bug or want to request a new feature, please open a GitHub issue.
Include a link to the reproduction scenario you created by forking one of the Clarity Stackblitz Templates for the version you are using at Clarity StackBlitz templates.
Support
For our support policies please visit https://clarity.design/get-started/support/
For questions, ideas, or just reaching out to the team feel free to open a discussion in our GitHub Disscussion section.
Date & Time Picker component (new)
Description
A Date or Time Picker is a component used to quickly select a date, dates, time, or date and time value in an input field.
Use cases under consideration
Future use cases under consideration
Documentation
Date Picker
Date Range Picker
Time Picker
Date & Time Picker
Quick Picker
References
Documentation is subject to change
Combobox component (new)
Description
Use cases under consideration
Documentation
Basic
Default view
Active view
Selections
Typing
Searching message
Multiselect
Option Groups
Custom Option Format
References
Syntax Error in @clr/core when using Jest
Describe the bug
After the @clr/core dependency of @clr/angular was introduced in 3.0, Jest is now throwing a syntax error coming from the new package.
How to reproduce
Please provide a link to a reproduction scenario using one of the Clarity Stackblitz templates. Reports without a clear reproduction may not be prioritized until one is provided.
Steps to reproduce the behavior:
Expected behavior
A clear and concise description of what you expected to happen.
Versions
App
Device:
Additional notes
Add any other notes about the problem here.
Datagrid Enhancement: Filtering
Description
Filtering in the datagrid component has been enhanced to include:
Documentation*
Filters (new section)
Filters are text-input based and are represented by dynamic labels above the datagrid. Filtering can be performed both on a per-column and cross-column level. Since this method of filtering is unique, explanations of how to add, clear, and edit filters are detailed below. Built-in filters currently include string filters—see Custom Filters [link to Custom Filters section] to find out how to build your own filters.
Adding filters
Filters can be added on a per-column or cross-column level. A dropdown of filtering suggestions will appear when the input is activated.
Per-column filters
Per-column filters are added by first typing or selecting the desired column to filter by, adding a “Key”. Any input typed or selected after the “Key:” is the “value” that will filter the column. Selecting an item from the dropdown or pressing enter will generate a filter.
Cross-column filters
Cross-column filters are added by directly typing the desired string to filter by into the input. Selecting an item from the dropdown or pressing enter will generate a filter. These filters are indicated with a globe icon.
Clearing filters
Individual filters can be cleared by clicking on the close icon of each filter.
When more than three filters are applied, a “Clear all” option will appear at the end of the filters to clear all active filters at once. A modal asking to confirm this destructive action will help prevent accidentally clearing all filters.
Editing filters
Filters can be edited by clicking on the text portion of the filter label. This will open the same input that was used to add the filter.
Built-in filters
String filter
String filters offer users a text input, and the rows will be filtered based on a string-matching function you provide. You should now be familiar with our use of interfaces for this, so here is the interface your string matcher should implement:
code examples here
String filter with preset value
Custom Filters (existing section)
If the built-in filters introduced in the Filters section did not meet your needs, you can write your own filter with a fully custom template and controller, and both wrap it in and pass it to a component in your column declaration. This can be done whether or not your column is declared as a clrDgField, and will always take precedence over it if it is.
code examples here
In our example, we can create a “color picker" filter, rather than have to search by color name.
Full datagrid demo (existing section)
*To be included with the current documentation for datagrids
Note: This design was adapted from Symphony's UI. Thank you to the Symphony team for contributing their solution to Clarity.
Related/original issues: #753
Datagrid Master Detail View Design
Select one ... (check one with "x")
Description
The datagrid master detail view allows users to dive into the details of particular items in the datagrid and quickly navigates between them. Today the Clarity provides the expandable row solution to show the details of particular items in the datagrid. However, we've heard use cases of using tabs, table, datagrid, stackview, etc. in the expandable view and the current solution might not scale well in these scenarios. The following paragraphs will describe our proposal to solve this problem.
Use cases under consideration
Future use cases under consideration
Drill down to more levels of details
Single Select
Click the detail view icon to bring up the detail view.

Clicking on the icon again or clicking on the close button on right upper corner will close the detail view.

Demo
Multi-select
Similar to single-select, click the detail view icon to bring up the detail view. Clicking on the icon again or clicking on the close button on right upper corner will close the detail view.

Demo
Show tabs, datagrid, table, stackview, etc. in the detail view
Tabs
Sometimes the detail view contains a lot of information and tabs are used to categorize it:
Datagrid/table/stackview
Sometimes the detial view contains datagrid, table or stackview:
If the items in the datagrid/table/stackview contains more details for the users to dive into, show the details in a pop-up:

When there are very few items in the master view
The Title of the Detail View
The title of the detail view doesn't have to match the content in the first column of the master view. It's defined by the product.
Expandable Datagrid
This is an available component of Clarity: https://vmware.github.io/clarity/documentation/v0.11/datagrid/expandable-rows
When the item has not much detail to show and it's text-only, expandable datagrid will be a quick and neat solution.

Documentation is subject to change
Timeline component (Static)
Summary
I'm proposing a timeline component implementation based on existing design spec from https://github.com/vmware/clarity/issues/1633. This change introduces a static version of the timeline using HTML/CSS. Accessibility will require some further evaluation as I'm not sure about the expectations on this topic.
Use case
The use case of a timeline component is to have visualized way of presenting a serious of pre-defined steps and show the current progress/status.
Examples
See demo at: https://clarity-timeline-demo-v3.stackblitz.io (Latest)
~~https://clarity-timeline-demo-v2.stackblitz.io~~ (Center justified horizontal, depricated)
~~https://clarity-light-theme-v1-0-xeza1u.stackblitz.io~~ (Embedded SVG icons, depricated)
Screenshots of demo:
API
The following HTML sample code demonstrates how the timeline component can be consumed from user side. Highlights are:
.clr-timeline
contains a number of.clr-timeline-step
blocks..clr-timeline-step
contains.clr-timeline-step-header
(Optional),clr-icon
and.clr-timeline-step-body
..clr-timeline-step-body
containsclr-timeline-step-title
andclr-timeline-step-description
..clr-timeline-horizontal
or.clr-timeline-vertical
class is added to.clr-timeline
to specify timeline type (direction)..not-started
,.is-current
,.in-progress
,.is-completed
and.is-error
can be added to each.clr-timeline-step
to indicate the step status.~~ (Replaced by specifying different clr-icon shapes).aria-label
is added to eachclr-icon
to show their meaning for screen reader.aria-current="true"
is added to current step icon.Implementation plan
Describe how you plan to implement the feature, answering questions among the following or anything else you deem relevant.
Conclusion
The current implementation follows the design spec and are mostly done from feature perspective. Some of the remaining items are: ~~- Some code cleanup.~~
Timelines (Yes, timelines of the timeline component):
TypeError: Class constructor CommonStringsService cannot be invoked without 'new'
Describe the bug
After updating to version
3.0.0-next.4
just runningng serve
will result in no compile errors. But you get a runtime error with CommonStringsService.Is clarity
3.x
intended to work with angular versions pre9.x
, e.g.8.2.0
?How to reproduce
Run
ng serve
and and open browser console.Expected behavior
It should just work?
Versions
App
[NG] Disable checkboxes in tree view
Add the ability to dynamically disable selection of tree node checkboxes.
closes the issue: https://github.com/vmware/clarity/issues/1458
Signed-off-by: Prudhvi Simhadri [email protected]
Vertical Navigation component (new)
Description
A Vertical Navigation is a component used to navigate users between pages of an application or site. Links within the navigation run down the side of a page versus across the top like Header or Subnav. Also known as side navigation or sidenav.
Use cases under consideration
Documentation
Layout Options
Icons
Hierarchy - basic
Hierarchy - icons
Collapse/Expand - basic
Collapse/Expand - hierarchy
Long labels
[Datagrid] Update and refresh for a data grid row breaks select all toggle functionality
Select one ... (check one with "x")
Expected behavior
Checkbox for each row on data grid should be checked.
Actual behavior
Checkbox for each row on data grid appears unchecked.
Reproduction of behavior
Stackblitz : https://stackblitz.com/edit/clr-datagrid-server-driven-demo-n4hqd3 (updated)
Environment details
Angular version: 5.2.0 and 6.0.1
Clarity version: 0.11.16
OS and version: Windows Server 2012
Browser: all
Note
If the
trackBy
option is not used then the grid works as expected. Stackblitz : https://stackblitz.com/edit/clr-datagrid-server-driven-demo-geauydTree view is not considering the states when collapsed state
Select one ... (check one with "x")
Expected behavior
In collpased state, if i uncheck or check that state will be consider.
Actual behavior
In collpse mode, if we change the state that state is not considering , it holds the previous ste only(it means, in expand mode what we selected i.e)
Reproduction of behavior
Environment details
Angular version: 2.0.X
Clarity version:
OS and version:
Browser: [all | Chrome XX | Firefox XX | IE XX | Safari XX | Mobile Chrome XX | Android X.X Web Browser | iOS XX Safari | iOS XX UIWebView | iOS XX WKWebView ]
Why is this repository archived?
This repository contained the code for both the Core (cds) and Angular (clr) versions of the design system and component library. The two code bases existed in separate branches.
To make it easier to contribute, we have split the source code into two new repositories. If your issue has been closed, but continues to exist, please recreate the issue in the appropriate repository: