Socket
Socket
Sign inDemoInstall

@leafygreen-ui/typography

Package Overview
Dependencies
91
Maintainers
5
Versions
94
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @leafygreen-ui/typography

leafyGreen UI Kit Typography


Version published
Weekly downloads
226K
decreased by-26.24%
Maintainers
5
Install size
13.9 MB
Created
Weekly downloads
 

Readme

Source

Typography

npm (scoped)

View on MongoDB.design

Installation

Yarn

yarn add @leafygreen-ui/typography

NPM

npm install @leafygreen-ui/typography

Peer Dependencies

PackageVersion
@leafygreen-ui/leafygreen-provider^1.1.0

Example

import { H1, H2, Subtitle, Body, InlineCode, InlineKeyCode, Disclaimer, Overline, Link, BackLink } from '@leafygreen-ui/typography';
<H1>Heading 1</H1>
<H2>Heading 2</H2>
<H3>Heading 3</H3>
<Subtitle>Subtitle</Subtitle>
<Body weight="medium">Body</Body>
<InlineCode>Code</InlineCode>
<>
  <InlineKeyCode>CTRL</InlineKeyCode>
  <InlineCode>+</InlineCode>
  <InlineKeyCode>C</InlineKeyCode>
</>
<Disclaimer>Disclaimer</Disclaimer>
<Overline>Overline</Overline>
<Link href="http://mongodb.design">MongoDB.design</Link>
<BackLink href="/home">MongoDB.design</BackLink>

Output HTML

<h1 class="leafygreen-ui-wbskfk">Heading 1</h1>
<h2 class="leafygreen-ui-1t0mh6j">Heading 2</h2>
<h3 class="leafygreen-ui-1t0mh6j">Heading 3</h3>
<h6 class="leafygreen-ui-1dmxpt6">Subtitle</h6>
<div class="leafygreen-ui-wkgw79">Body</div>
<code class="leafygreen-ui-18bk0d8">Code</code>
<code class="leafygreen-ui-1vl51l4">CTRL</code
><code class="leafygreen-ui-1vl51l4">+</code
><code class="leafygreen-ui-1vl51l4">C</code>
<small class="leafygreen-ui-1cggyhz">Disclaimer</small>
<div class="leafygreen-ui-vezyzr">Overline</div>
<a
  href="http://mongodb.design"
  target="_blank"
  class="leafygreen-ui-1toaa4e"
  data-leafygreen-ui="anchor-container"
>
  <span>MongoDB.design</span>
  <svg
    width="16px"
    height="16px"
    viewBox="0 0 16 16"
    xmlns="http://www.w3.org/2000/svg"
    xmlns:xlink="http://www.w3.org/1999/xlink"
  >
    <title>Open in New Tab</title>
  </svg>
</a>

Properties

All props extend the HTMLElementProps of their root tag, however the below components accept extra props

ComponentRoot
H1h1
H2h2
H3h3
Subtitleh6
Bodyp
InlineCodecode
InlineKeyCodecode
Disclaimersmall
Overlinep
Linka
BackLinka
Labellabel
Descriptionp
Labelp

H1

PropTypeDescriptionDefault
darkModebooleanDetermines if the component renders in dark modefalse
asReact.ElementTypeElement to render the component as. Note: This will supersede the behavior of any other props.'h1'

H2

PropTypeDescriptionDefault
darkModebooleanDetermines if the component renders in dark modefalse
asReact.ElementTypeElement to render the component as. Note: This will supersede the behavior of any other props.'h2'

H3

PropTypeDescriptionDefault
darkModebooleanDetermines if the component renders in dark modefalse
asReact.ElementTypeElement to render the component as. Note: This will supersede the behavior of any other props.'h3'

Subtitle

PropTypeDescriptionDefault
darkModebooleanDetermines if the component renders in dark modefalse
asReact.ElementTypeElement to render the component as. Note: This will supersede the behavior of any other props.'h6'

Body

PropTypeDescriptionDefault
weight'regular' | 'medium'font-weight applied to typography element'regular'
darkModebooleanDetermines if the component renders in dark modefalse
asReact.ElementTypeElement to render the component as. Note: This will supersede the behavior of any other props.'p'
baseFontSize13 | 16font-size applied to typography elementDefaults to value set by LeafyGreen Provider.

InlineCode

PropTypeDescriptionDefault
hrefstring | undefinedIf an href prop is passed to InlineCode it will be rendered with an a tag wrapping the code tag. Otherwise, it'll simply render as a code tag.
darkModebooleanDetermines if the component renders in dark mode
baseFontSize13 | 16font-size applied to typography elementDefaults to value set by LeafyGreen Provider.

InlineKeyCode

PropTypeDescriptionDefault
darkModebooleanDetermines if the component renders in dark mode
baseFontSize13 | 16font-size applied to typography elementDefaults to value set by LeafyGreen Provider.

Disclaimer

PropTypeDescriptionDefault
darkModebooleanDetermines if the component renders in dark modefalse

Error

PropTypeDescriptionDefault
darkModebooleanDetermines if the component renders in dark modefalse

Overline

PropTypeDescriptionDefault
asReact.ElementTypeThe component or Element to render the component as. Note: This will supersede the behavior of any other props.p
darkModebooleanDetermines if the component renders in dark modefalse
PropTypeDescriptionDefault
arrowAppearance'hover', 'persist', 'none'Displays a right arrow adjacent to the anchor tag. When set to persist the arrow will always be present. When set to hover, the arrow will only appear when hovering over the arrow.'none'
hideExternalIconbooleanHides the external icon when the current host name is different from the host of the destination URLfalse
darkModebooleanDetermines if the component renders in dark modefalse
asReact.ElementTypeElement to render the component as. Note: This will supersede the behavior of any other props.'a'
baseFontSize13 | 16font-size applied to typography elementDefaults to value set by LeafyGreen Provider.

Note: BackLink is intended for internal linking only

PropTypeDescriptionDefault
darkModebooleanDetermines if the component renders in dark modefalse
asReact.ElementTypeElement to render the component as. Note: This will supersede the behavior of any other props.'a'
baseFontSize13 | 16font-size applied to typography elementDefaults to value set by LeafyGreen Provider.

Label

PropTypeDescriptionDefault
darkModebooleanDetermines if the component renders in dark modefalse
disabledbooleanDetermines whether the component should appear disabledfalse
baseFontSize13 | 16font-size applied to typography elementDefaults to value set by LeafyGreen Provider.
asReact.ElementTypeThe component or Element to render the component as. Note: This will supersede the behavior of any other props.label

Description

PropTypeDescriptionDefault
darkModebooleanDetermines if the component renders in dark modefalse
baseFontSize13 | 16font-size applied to typography elementDefaults to value set by LeafyGreen Provider.

FAQs

Last updated on 15 Apr 2024

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc