Socket
Book a DemoInstallSign in
Socket

@leafygreen-ui/tokens

Package Overview
Dependencies
Maintainers
6
Versions
65
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@leafygreen-ui/tokens

leafyGreen UI Kit Tokens

Source
npmnpm
Version
2.12.1
Version published
Weekly downloads
183K
69.95%
Maintainers
6
Weekly downloads
 
Created

What is @leafygreen-ui/tokens?

@leafygreen-ui/tokens is a design token library provided by MongoDB's LeafyGreen UI team. It offers a set of design tokens that can be used to maintain consistency in design across different components and applications. These tokens include colors, typography, spacing, and other design-related constants.

What are @leafygreen-ui/tokens's main functionalities?

Colors

This feature provides a set of predefined color tokens that can be used to ensure consistent color usage across your application.

import { color } from '@leafygreen-ui/tokens';

const primaryColor = color.green.base;
console.log(primaryColor); // Outputs: '#13AA52'

Typography

This feature offers typography tokens such as font sizes and line heights to maintain consistent text styling.

import { fontSize, lineHeight } from '@leafygreen-ui/tokens';

const headingStyle = {
  fontSize: fontSize.h1,
  lineHeight: lineHeight.h1,
};
console.log(headingStyle); // Outputs: { fontSize: '32px', lineHeight: '40px' }

Spacing

This feature provides spacing tokens that can be used for margins and paddings to ensure consistent spacing throughout your application.

import { spacing } from '@leafygreen-ui/tokens';

const containerStyle = {
  padding: spacing[4],
};
console.log(containerStyle); // Outputs: { padding: '16px' }

Other packages similar to @leafygreen-ui/tokens

FAQs

Package last updated on 02 Apr 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts