Socket
Socket
Sign inDemoInstall

@leafygreen-ui/typography

Package Overview
Dependencies
Maintainers
4
Versions
100
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


Version published
Maintainers
4
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 04 Oct 2022

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc