Socket
Socket
Sign inDemoInstall

@lightspeed/cirrus-text

Package Overview
Dependencies
70
Maintainers
7
Versions
12
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @lightspeed/cirrus-text

Cirrus Text Component


Version published
Weekly downloads
75
increased by8.7%
Maintainers
7
Created
Weekly downloads
 

Readme

Source

Text

Base component for every Text styles.

Installation

First, make sure you have been through the Getting Started steps of adding Cirrus in your application.

If using Yarn:

yarn add @lightspeed/cirrus-text

Or using npm:

npm i -S @lightspeed/cirrus-text

React Component

<Text>

Note: This components supports multiple properties from styled-system.

  • TextColor
  • FontSize
  • FontWeight
  • Space
  • LineHeight
  • LetterSpacing
  • TextTransform

Styled System API

PropTypeDescriptionDefault
elementstringHTML element for text'p'
childrenReact.ReactNodeThe content to display inside the text-
classNamestringExtra CSS classes appended to end of text element-
fontWeightstringSet the font-weight for the text-
colorstringAny Cirrus color token, ex green-100 or CSS value.-
sizeenum('small', 'normal', 'large', 'xlarge')Automatically apply font size and line-height. This property will take precedence over styled-system props-
<Heading1> <Heading2> <Heading3> <Heading4>

Note: This components supports multiple properties from styled-system.

  • TextColor
  • FontSize
  • FontWeight
  • Space
  • LineHeight
  • LetterSpacing
  • TextTransform

Styled System API

PropTypeDescriptionDefault
childrenReact.ReactNodeThe content to display inside the text-
fontWeightstringSet the font-weight for the text-
colorstringAny Cirrus color token, ex green-100 or CSS value.-
PropTypeDescriptionDefault
childrenReact.ReactNodeThe content to display inside the link-
classNamestringExtra CSS classes appended to end of link element-
fontWeightstringSet the font-weight for the text-
<TextContent>
PropTypeDescriptionDefault
childrenReact.ReactNodeThe content to display. An extra class will be applied to each children of type <Text> to add spacing-
Example
import React from 'react';
import { Text, Heading1, TextLink, TextContent } from '@lightspeed/cirrus-text';

const MyComponent = () => (
  <div>
    <Heading1>Heading</Heading1>
    <Text>Body text</Text>
    <TextLink href="https://www.lightspeedhq.com">Link</TextLink>
    <TextContent>
      <Heading1>Heading content</Heading1>
      <Text>Body text content</Text>
      <TextLink href="https://www.lightspeedhq.com">Link</TextLink>
    </TextContent>
  </div>
);

export default MyComponent;

FAQs

Last updated on 03 Dec 2018

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