Salt Design System

repository·main·Indexed 41 days ago

https://github.com/jpmorganchase/salt-ds

A suite of lightweight, performant, and WCAG 2.1 compliant UI components and a flexible theming system. It includes stable components in @salt-ds/core, experimental components in @salt-ds/lab, and specialized integrations for AG Grid, Highcharts, and date components.

Tokens
221K
Snippets
582
Records
1.5K
Agent score
52%

What's inside Salt

  1. Overview of the Salt Design System

    main

    Salt is J.P. Morgan's open-source design system. It provides accessible components and design resources to create digital experiences across various lines of business.

    Key characteristics of the system include:

    • Small components, flexible patterns: Instead of building every possible component, Salt focuses on high-quality, small components and provides pattern examples to demonstrate how to compose them for specific business requirements.
    • Lightweight and dependency-light: The system aims for minimal dependencies and is built from the ground up to be customizable and easy to maintain.
    • Composable APIs: Component APIs are designed to be consistent and composable, allowing them to work together for nuanced use cases.
    • Systematic spacing grid: All components support four density systems using a 4px scaling grid, ensuring cohesive layouts regardless of data density.
    • WCAG 2.1 accessibility: Components are built to meet WCAG 2.1 AA standards as a core requirement.
    • Token-driven styling: Styling is managed through an abstraction of CSS variables (design tokens) using vanilla CSS, without reliance on third-party styling libraries.
  2. Overview of Salt Design System Foundations

    main

    Salt Foundations consist of the fundamental principles and design tokens used to create a cohesive design language. These foundations ensure that components and patterns are visually consistent, accessible, and easy to use.

    Key areas covered by the foundations include:

    • Assets: Icons and country symbols for visual representation.
    • Visual Styles: Border styles, color palettes (including light/dark modes), typography, and cursor behaviors.
    • Spatial & Dimensional: Spacing, size (dimensions), density, and responsiveness for different screen sizes.
    • Depth & Motion: Elevation (shadows and z-index) and duration (timing for system feedback).
    • Data Visualization: Principles for presenting information visually.
  3. Use the Combo box component

    main

    The ComboBox component (part of @salt-ds/core) allows users to select an item from a large list of options using typeahead functionality. It combines an input field with an overlay list that filters as the user types. Once a selection is made, the field is populated and the overlay closes. It is a more efficient alternative to a standard Dropdown when dealing with large datasets where scrolling is inefficient.

    Commonly referred to as:

    • Typeahead
    • Editable Dropdown
    • List Box
    • Autocomplete
    • Autosuggest
  4. Use GridLayout for responsive UI arrangements

    main

    The GridLayout component from @salt-ds/core allows you to arrange UI elements within a system of columns and rows. It is designed to create evenly distributed, responsive, and organized interfaces, making it ideal for positioning repeating widgets in areas like a Dashboard.

    To handle different viewports, you can combine GridLayout with GridItem and responsive breakpoints to control how content is displayed across various screen sizes.

    import { GridLayout, GridItem } from '@salt-ds/core';
  5. Use the SystemStatus component for platform alerts

    main

    The SystemStatus component (also known as System Message) is used to communicate essential platform-wide information, such as maintenance or outage alerts. It is designed to be noticed immediately and prompts users to take action based on one of four severity levels. Each severity level includes a specific icon and color scheme:

    • info: Informational messages.
    • success: Positive confirmation or successful state.
    • warning: Cautionary alerts that require attention.
    • error: Critical alerts or outages.

    This component is part of the @salt-ds/lab package.

  6. Use the Menu component

    main

    The Menu component is a container used to present a selection of choices or actions. It is also known as a Cascading Menu. Users typically open the menu via a customizable trigger, such as an interactive button, a keyboard shortcut, or a mouse right-click. It is part of the @salt-ds/core package.

    Related Components:

    • Dropdown: A similar UI pattern.
    • Icon: Can be used inside menu items.
  7. Use the Slider component from @salt-ds/core

    main

    The Slider component allows users to select a single value from a track. It supports tooltips on hover/focus, custom steps, marks, and accessibility features like custom screen reader text.

    Key props for basic usage:

    • min / max: Define the range.
    • value: The current selected value (use for controlled components).
    • step: The increment value (defaults to 1).
    • onChange: Callback triggered continuously during interaction.
    • onChangeEnd: Callback triggered when the interaction finishes.
    import { Slider } from '@salt-ds/core';
    
    // Basic usage
    <Slider min={0} max={100} defaultValue={50} />