You're Invited: Meet the Socket team at BSidesSF and RSAC - April 27 - May 1.RSVP
Socket
Sign inDemoInstall
Socket

@leafygreen-ui/typography

Package Overview
Dependencies
Maintainers
6
Versions
111
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@leafygreen-ui/typography

leafyGreen UI Kit Typography

20.1.7
latest
Source
npm
Version published
Weekly downloads
597K
-10.3%
Maintainers
6
Weekly downloads
 
Created

What is @leafygreen-ui/typography?

@leafygreen-ui/typography is a React component library that provides a set of typography components designed to align with MongoDB's design system. It allows developers to easily implement consistent and accessible typography styles in their applications.

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

Basic Typography

This feature allows you to use predefined typography components like H1 and Body to create headings and body text with consistent styling.


import { H1, Body } from '@leafygreen-ui/typography';

function App() {
  return (
    <div>
      <H1>Heading 1</H1>
      <Body>Body text goes here.</Body>
    </div>
  );
}

Customizing Typography

This feature allows you to customize the typography components by adding custom CSS classes to change their appearance.


import { H2, Subtitle } from '@leafygreen-ui/typography';

function CustomTypography() {
  return (
    <div>
      <H2 className="custom-heading">Custom Heading</H2>
      <Subtitle className="custom-subtitle">Custom Subtitle</Subtitle>
    </div>
  );
}

// CSS
.custom-heading {
  color: #4caf50;
}

.custom-subtitle {
  font-style: italic;
}

Responsive Typography

This feature demonstrates how to create responsive typography that changes based on the screen size using media queries.


import { H3, Overline } from '@leafygreen-ui/typography';
import { useMediaQuery } from 'react-responsive';

function ResponsiveTypography() {
  const isMobile = useMediaQuery({ maxWidth: 767 });

  return (
    <div>
      <H3>{isMobile ? 'Mobile Heading' : 'Desktop Heading'}</H3>
      <Overline>{isMobile ? 'Mobile Overline' : 'Desktop Overline'}</Overline>
    </div>
  );
}

Other packages similar to @leafygreen-ui/typography

FAQs

Package last updated on 08 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