Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@commercetools-uikit/text

Package Overview
Dependencies
Maintainers
3
Versions
851
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@commercetools-uikit/text

## Usage

  • 0.0.0-canary-20206812259
  • Source
  • npm
  • Socket score

Version published
Maintainers
3
Created
Source

Typography: Text

Usage

// NOTE: the main import is not a React component, instead you need to use one
// of the types defined in the component.
import { Text } from '@commercetools-frontend/ui-kit/typography/text';

<Text.Headline>

Wraps the given text in the given HTML header size.

Usage
<Text.Headline as="h1">{'The title'}</Text.Headline>
Properties
PropsTypeRequiredValuesDefaultDescription
asString['h1', 'h2', 'h3']--
childrenPropTypes.node✅ (*)---
intlMessageintl message✅ (*)--An intl message object that will be rendered with FormattedMessage
titleString---Text to show in a tooltip on hover over the element
truncateBool--falseOption for truncate content in case the screen has small width
elementTypeString-['h1', 'h2', 'h3']-⚠️ Deprecated

*: children is required only if intlMessage is not provided

The component further forwards all data- attributes to the underlying component.

Where to use

Title of pages.

<Text.Subheadline>

Wraps the given text in the given HTML header size.

Usage
<Text.Subheadline elementType="h4">{'The subtitle'}</Text.Subheadline>
Properties
PropsTypeRequiredValuesDefault
asString['h4', 'h5']-
isBoldBoolean--false
toneString-['primary', 'secondary', 'information', 'positive', 'negative']-
childrenPropTypes.node✅ (*)--
intlMessageintl message✅ (*)--
titleString---
truncateBool--false
elementTypeString-['h4', 'h5']-

*: children is required only if intlMessage is not provided

The component further forwards all data- attributes to the underlying component.

Where to use

Subtitle of pages.

<Text.Wrap>

Wraps the given text in its container. And for long text, text will be wrapped to new line.

Usage
<Text.Wrap>{'Sooo long text'}</Text.Wrap>
Where to use

When we render value that may be vey long, and we prefer to wrap text to new line after it exceeds its wrapper's width.

<Text.Body>

Wraps the given text in a <p> element, for normal content.

Usage
<Text.Body>{'This is a content'}</Text.Body>
Properties
PropsTypeRequiredValuesDefault
asString-['p', 'span']-
isBoldBoolean--false
isItalicBoolean--false
toneString-['primary', 'secondary', 'information', 'positive', 'negative', 'inverted']-
childrenPropTypes.node✅ (*)--
intlMessageintl message✅ (*)--
titleString---
truncateBool--false
isInlineBool--false

*: children is required only if intlMessage is not provided

The component further forwards all data- attributes to the underlying component.

Where to use

Content text in general.

<Text.Detail>

Wraps the given text in a <small> semantic tag. It accepts a tone prop to properly style the text.

Usage
<Text.Detail>{'This would be something small'}</Text.Detail>
<Text.Detail tone="secondary">{'This would be something small with the secondary tone applied'}</Text.Detail>
Properties
PropsTypeRequiredValuesDefault
isBoldBoolean--false
isItalicBoolean--false
toneString-['primary', 'secondary', 'information', 'positive', 'negative', 'warning'']-
childrenPropTypes.node✅ (*)--
intlMessageintl message✅ (*)--
titleString---
truncateBool--false
isInlineBool--false

*: children is required only if intlMessage is not provided

The component further forwards all data- attributes to the underlying component.

Where to use

Details text of form boxes.

FAQs

Package last updated on 08 Jul 2020

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