npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@elemental-ui-alpha/typography

v0.0.2

Published

Elemental provides a constrained, purposeful set of typographic styles as components.

Downloads

7

Readme

Typography

import { Anchor, Heading, HorizontalRule, Text } from '@elemental/typography';

Common Props

Margins

The Text and Heading components accept margin properties:

  • margin all around
  • marginTop top
  • marginRight right
  • marginBottom bottom
  • marginLeft left
  • marginX both left and right
  • marginY both top and bottom
<>
  <Heading level="4" marginTop="small">
    Small margin on top
  </Heading>
  <Text marginY="large">Large margin on both top and bottom</Text>
</>

"As" element

To promote semantic HTML the Text and Heading components accept an as property, which will replace the default element that is rendered.

<>
  <Heading level="4" as="h2">
    The h2 styles on an h3 element.
  </Heading>
  <Text as="label">Text styles on a label element.</Text>
</>

Leading

Tighten or loosen the leading of your content. This translates to line-height in CSS.

  • looser
  • loose
  • regular (default)
  • tight
  • tighter
<Stack gap="large">
  <Heading level="4" leading="loose">
    Wafer dessert topping halvah chupa chups pudding sweet cupcake candy.
    Caramels tootsie roll muffin chupa chups macaroon gingerbread carrot cake
    oat cake.
  </Heading>
  <Text leading="regular">
    Wafer dessert topping halvah chupa chups pudding sweet cupcake candy.
    Caramels tootsie roll muffin chupa chups macaroon gingerbread carrot cake
    oat cake.
  </Text>
  <Text leading="tight">
    Wafer dessert topping halvah chupa chups pudding sweet cupcake candy.
    Caramels tootsie roll muffin chupa chups macaroon gingerbread carrot cake
    oat cake.
  </Text>
</Stack>

Tracking

Tighten or loosen the tracking of your content. This translates to letter-spacing in CSS.

  • looser
  • loose
  • regular (default)
  • tight
  • tighter
<Stack gap="large">
  <Heading level="4" tracking="loose">
    Wafer dessert topping halvah chupa chups pudding sweet cupcake candy.
    Caramels tootsie roll muffin chupa chups macaroon gingerbread carrot cake
    oat cake.
  </Heading>
  <Text tracking="regular">
    Wafer dessert topping halvah chupa chups pudding sweet cupcake candy.
    Caramels tootsie roll muffin chupa chups macaroon gingerbread carrot cake
    oat cake.
  </Text>
  <Text tracking="tighter">
    Wafer dessert topping halvah chupa chups pudding sweet cupcake candy.
    Caramels tootsie roll muffin chupa chups macaroon gingerbread carrot cake
    oat cake.
  </Text>
</Stack>

Heading

Use the Heading component for dynamic levels, 1-6 available.

<>
  <Heading level="1">Heading level 1</Heading>
  <Heading level="2">Heading level 2</Heading>
  <Heading level="3">Heading level 3</Heading>
  <Heading level="4">Heading level 4</Heading>
  <Heading level="5">Heading level 5</Heading>
  <Heading level="6">Heading level 6</Heading>
</>

Text

Influence text styles within the constraints of the theme.

Size

Apply various font sizes:

  • xsmall
  • small
  • medium (default)
  • large
  • xlarge
<Stack gap="small">
  <Text size="xsmall">Cupcake bonbon pudding pie toffee.</Text>
  <Text size="small">
    Chocolate bar chocolate cake apple pie lemon drops. Halvah candy jelly-o pie
    donut powder marzipan.
  </Text>
  <Text size="medium">
    Liquorice lemon drops topping pie sesame snaps bonbon jujubes lemon drops.
  </Text>
  <Text size="large">
    Cake cotton candy jujubes tiramisu soufflé toffee bear claw.
  </Text>
  <Text size="xlarge">Candy canes sweet roll jujubes macaroon.</Text>
</Stack>

Foreground

Apply an alternative foreground colour.

<Stack gap="small">
  <Text foreground="text">The default foreground color.</Text>
  <Text foreground="muted">Muted for slightly less important content.</Text>
  <Text foreground="dim">Dim down this content for a dull appearance.</Text>
  <Text foreground="critical">Oh no, something's gone wrong!</Text>
  <Text foreground="positive">Something good, probably.</Text>
  <Text foreground="info">Some informative text.</Text>
</Stack>

Miscellaneous

Horizontal Rule

Add a divider to your content.

<>
  <Text>Cheesecake candy halvah pie carrot cake tiramisu gummi bears.</Text>
  <HorizontalRule marginY="small" />
  <Text>Topping apple pie donut gummies chocolate bar pudding pie wafer.</Text>
</>

Anchor

Use Anchor for inline link text. Available in two variants:

  • normal (default)
  • subtle
<>
  <Text>
    Jelly beans topping <Anchor href="#">cupcake</Anchor> danish donut.
  </Text>
  <Text>
    Muffin{' '}
    <Anchor variant="subtle" href="#">
      toffee tart
    </Anchor>{' '}
    chocolate cake.
  </Text>
  <Text>
    External links are emphasised with a{' '}
    <Anchor external href="#">
      disclosure icon
    </Anchor>
  </Text>
</>