Salt Design System
repository·main·Indexed 41 days ago
https://github.com/jpmorganchase/salt-dsA 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.
What's inside Salt
- Salt is the J.P. Morgan design system. It is an open-source solution designed for building digital experiences and products, specifically optimized for financial services and other industries.
Overview of Salt Layout components
mainSalt Layout components are designed to help build consistent and responsive layouts when using Salt components. They are built using CSS Grid and Flexbox to provide spatial consistency out of the box, while allowing for easy customization and responsive behavior.Overview of the Salt Design System
mainSalt 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.
Overview of Salt Design System Foundations
mainSalt 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.
Use the Carousel pattern from @salt-ds/embla-carousel
mainThe@salt-ds/embla-carouselpackage provides a carousel implementation based on the embla-carousel engine. It is designed to provide a consistent carousel pattern within the Salt Design System ecosystem.Use the Tree component to display hierarchical data
mainTheTreecomponent (also known as a Tree view) is used to display hierarchical data in an expandable and collapsible structure. It allows users to navigate through nested items and supports optional selection of one or more nodes. This component is part of the@salt-ds/corepackage.Use the Combo box component
mainThe
ComboBoxcomponent (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 standardDropdownwhen dealing with large datasets where scrolling is inefficient.Commonly referred to as:
- Typeahead
- Editable Dropdown
- List Box
- Autocomplete
- Autosuggest
Use GridLayout for responsive UI arrangements
mainThe
GridLayoutcomponent from@salt-ds/coreallows 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
GridLayoutwithGridItemand responsive breakpoints to control how content is displayed across various screen sizes.import { GridLayout, GridItem } from '@salt-ds/core';Use the Panel component to organize content
mainThe
Panelcomponent is used to organize content into distinct regions within an application. It conveys visual hierarchy through the use of background color and elevation. It is conceptually similar to aCardor aContainer.import { Panel } from '@salt-ds/core';Use the SystemStatus component for platform alerts
mainThe
SystemStatuscomponent (also known asSystem 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/labpackage.Use the Menu component
mainThe
Menucomponent is a container used to present a selection of choices or actions. It is also known as aCascading 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/corepackage.Related Components:
Dropdown: A similar UI pattern.Icon: Can be used inside menu items.
Use the Slider component from @salt-ds/core
mainThe
Slidercomponent 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} />