19.1.0 • Published 1 day ago

@commercetools-uikit/text v19.1.0

Weekly downloads
5,264
License
MIT
Repository
github
Last release
1 day ago

Typography: Text

Description

The Text component implements the typography elements such as headings, paragraphs, etc.

<Text.Headline>

Wraps the given text in the given HTML header size.

Usage

import Text from '@commercetools-uikit/text';

<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
idString---Used as HTML id property
titleString---Text to show in a tooltip on hover over the element
truncateBool--falseOption for truncate content in case the screen has small width
nowrapBool--falseThe content in the element will not be wrapped to a new line unless explicitly specified.

*: 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

import Text from '@commercetools-uikit/text';

<Text.Subheadline as="h4">{'The subtitle'}</Text.Subheadline>;

Properties

PropsTypeRequiredValuesDefault
asString['h4', 'h5']-
idString---Used as HTML id property
isBoldBoolean--false
toneString-['primary', 'secondary', 'tertiary', 'information', 'positive', 'negative']-
childrenPropTypes.node✅ (*)--
intlMessageintl message✅ (*)--An intl message object that will be rendered with FormattedMessage
titleString---
truncateBool--false
nowrapBool--falseThe content in the element will not be wrapped to a new line unless explicitly specified.

*: 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

import Text from '@commercetools-uikit/text';

<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

import Text from '@commercetools-uikit/text';

<Text.Body>{'This is a content'}</Text.Body>;

Properties

PropsTypeRequiredValuesDefault
asString-['p', 'span']-
idString---Used as HTML id property
isBoldBoolean--falseThis prop is being deprecated in favor of the fontWeight prop
fontWeightString-['regular', 'medium', 'bold']regular
isItalicBoolean--false
isStrikethroughBoolean--false
toneString-['primary', 'secondary', 'tertiary', 'information', 'positive', 'negative', 'inverted']-
childrenPropTypes.node✅ (*)--
intlMessageintl message✅ (*)--An intl message object that will be rendered with FormattedMessage
titleString---
truncateBool--false
nowrapBool--falseThe content in the element will not be wrapped to a new line unless explicitly specified.

*: 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

import Text from '@commercetools-uikit/text';

<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
asstring-['small', 'span'] [^]false
idString---Used as HTML id property
isBoldBoolean--falseThis prop is being deprecated in favor of the fontWeight prop
fontWeightString-['regular', 'medium', 'bold']regular
isItalicBoolean--false
isStrikethroughBoolean--false
toneString-['primary', 'secondary', 'tertiary', 'information', 'positive', 'negative', 'warning'']-
childrenPropTypes.node✅ (*)--
intlMessageintl message✅ (*)--An intl message object that will be rendered with FormattedMessage
titleString---
truncateBool--false
aria-labelledbyString---HTML ID of an element containing the label for the text rendered in this component
nowrapBool--falseThe content in the element will not be wrapped to a new line unless explicitly specified.

*: children is required only if intlMessage is not provided. [^]: Use as prop to render an inline element.

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

Where to use

Details text of form boxes.

<Text.Caption>

Wraps the text in the smallest available font size and accepts tone and fontWeight props.

Usage

import Text from '@commercetools-uikit/text';

<Text.Caption as="h4">{'The caption'}</Text.Caption>;

Properties

PropsTypeRequiredValuesDefaultDescription
idString---Used as HTML id property
isItalicBoolean--false
isStrikethroughBoolean--false
toneString-['primary', 'secondary','tertiary', 'information', 'positive','negative', 'critical', 'inherit','warning','inverted']
fontWeightString-['regular', 'medium', 'bold']regular
truncateBool--falseOption for truncate content in case the screen has small width
nowrapBool--falseThe content in the element will not be wrapped to a new line unless explicitly specified.
aria-labelledbyString---HTML ID of an element containing the label for the text rendered in this component
titleString---Text to show in a tooltip on hover over the element
childrenPropTypes.node✅ (*)---
intlMessageintl message✅ (*)--An intl message object that will be rendered with FormattedMessage

*: children is required only if intlMessage is not provided

Where to use

Text.Caption is the smallest available font size in our design system. From the visual hierarchy perspective, it sits on the last spot of the importance scale and therefor should be used sparingly only in specific situations:

  • The text does not have high importance and is not crucial to complete a task.
  • In an information dense UI where using a bigger font size would harm the visual hierarchy of the page.
  • For small descriptive labels, or tooltips, that provide helpful additional information in a given context.
  • Text.Caption should not be used in text paragraphs longer than 1-2 sentences.
@commercetools-frontend/application-shell@commercetools-docs/gatsby-theme-docs@commercetools-uikit/async-select-input@commercetools-uikit/async-creatable-select-input@commercetools-uikit/collapsible-panel@commercetools-uikit/creatable-select-input@commercetools-uikit/data-table-manager@commercetools-uikit/localized-rich-text-input@commercetools-uikit/localized-multiline-text-input@commercetools-uikit/search-select-input@commercetools-uikit/localized-text-input@everything-registry/sub-chunk-190@infinitebrahmanuniverse/nolb-_comm@commercetools-uikit/stamp@commercetools-uikit/table@commercetools-uikit/select-utils@commercetools-uikit/tag@commercetools-frontend/cookie-consent@commercetools-uikit/flat-button@commercetools-uikit/field-label@commercetools-uikit/link-button@commercetools-uikit/loading-spinner@commercetools-uikit/icon-button@commercetools-uikit/label@commercetools-uikit/primary-action-dropdown@commercetools-uikit/pagination@commercetools-uikit/primary-button@commercetools-uikit/progress-bar@commercetools-uikit/messages@commercetools-uikit/secondary-icon-button@commercetools-uikit/secondary-button@commercetools-frontend/ui-kit@commercetools-uikit/base-table@commercetools-uikit/calendar-utils@commercetools-uikit/calendar@commercetools-community-kit/pickers@commercetools-docs/ui-kit@commercetools-frontend-extensions/change-history@commercetools-docs/gatsby-theme-learning@commercetools-frontend/application-components@commercetools-uikit/date-input@commercetools-uikit/date-range-input@commercetools-uikit/date-time-input
19.1.0

6 days ago

19.0.0

1 month ago

18.5.0

1 month ago

18.4.0

1 month ago

18.3.0

2 months ago

18.2.0

2 months ago

18.1.0

2 months ago

18.0.0

2 months ago

17.1.0

3 months ago

17.0.1

3 months ago

17.0.0

3 months ago

16.12.1

5 months ago

16.12.0

5 months ago

16.5.0

10 months ago

16.6.1

8 months ago

16.6.0

8 months ago

16.4.1

10 months ago

16.9.0

6 months ago

16.7.3

8 months ago

16.7.2

8 months ago

16.7.1

8 months ago

16.7.0

8 months ago

16.7.5

7 months ago

16.7.4

7 months ago

16.8.0

6 months ago

16.11.0

5 months ago

16.10.0

5 months ago

16.4.0

10 months ago

16.3.0

10 months ago

16.2.1

11 months ago

16.2.0

11 months ago

16.1.1

11 months ago

16.1.0

12 months ago

15.15.0

1 year ago

15.15.1

1 year ago

16.0.0

1 year ago

15.13.2

1 year ago

15.14.3

1 year ago

15.14.1

1 year ago

15.14.2

1 year ago

15.14.0

1 year ago

15.13.1

1 year ago

15.13.0

1 year ago

15.12.0

1 year ago

15.9.0

1 year ago

15.10.0

1 year ago

15.11.2

1 year ago

15.11.0

1 year ago

15.11.1

1 year ago

15.7.0

1 year ago

15.8.0

1 year ago

15.5.0

1 year ago

15.5.1

1 year ago

15.6.0

1 year ago

15.4.0

1 year ago

15.3.0

2 years ago

15.2.4

2 years ago

15.2.1

2 years ago

15.2.2

2 years ago

15.2.3

2 years ago

15.1.1

2 years ago

15.1.2

2 years ago

15.1.0

2 years ago

15.2.0

2 years ago

15.0.0

2 years ago

14.0.0

2 years ago

14.0.1

2 years ago

13.0.4

2 years ago

13.0.2

2 years ago

13.0.0

2 years ago

12.2.9

2 years ago

12.2.5

2 years ago

12.2.4

3 years ago

12.2.3

3 years ago

12.2.2

3 years ago

12.2.0

3 years ago

12.1.0

3 years ago

12.0.12

3 years ago

12.0.8

3 years ago

12.0.7

3 years ago

12.0.0

3 years ago

11.2.1

3 years ago

11.2.0

3 years ago

11.0.2

3 years ago

11.0.1

3 years ago

10.47.3

3 years ago

10.47.0

3 years ago

10.46.3

3 years ago

10.46.2

3 years ago

10.46.1

3 years ago

10.45.0

3 years ago

10.44.4

3 years ago

10.44.0

3 years ago

10.43.3

3 years ago

10.43.2

3 years ago

10.42.2

3 years ago

10.42.0

3 years ago

10.42.1

3 years ago

10.41.0

3 years ago

10.40.0

3 years ago

10.39.8

3 years ago

10.39.7

3 years ago

10.39.6

3 years ago

10.39.4

3 years ago

10.39.3

3 years ago

10.39.2

3 years ago

10.39.1

3 years ago

10.36.0

4 years ago

10.35.1

4 years ago

10.30.1

4 years ago

10.27.0

4 years ago

10.24.0

4 years ago

10.21.0

4 years ago

10.18.7-canary.5

4 years ago

10.18.7-canary.6

4 years ago

10.18.7-canary.7

4 years ago

10.18.7-canary.4

4 years ago

10.18.7-canary.3

4 years ago

10.18.7-canary.2

4 years ago

10.18.7-canary.1

4 years ago

10.18.6-canary.1

4 years ago

10.18.7-canary.0

4 years ago

10.18.5-canary.4

4 years ago

10.18.6-canary.0

4 years ago

10.18.5-canary.3

4 years ago

10.18.5-canary.2

4 years ago

10.18.5-canary.1

4 years ago

10.18.5-canary.0

4 years ago

10.18.4

4 years ago

10.18.4-canary.9

4 years ago

10.18.4-canary.8

4 years ago

10.18.4-canary.7

4 years ago

10.18.4-canary.6

4 years ago

10.18.4-canary.3

4 years ago

10.18.4-canary.4

4 years ago

10.18.4-canary.5

4 years ago

10.18.4-canary.1

4 years ago

10.18.4-canary.2

4 years ago

10.18.4-canary.0

4 years ago

10.18.3-canary.2

4 years ago

10.18.3-canary.3

4 years ago

10.18.3-canary.1

4 years ago

10.18.3-canary.0

4 years ago

10.18.2-canary.3

4 years ago

10.18.2-canary.2

4 years ago

10.18.2-canary.1

4 years ago

10.17.1-canary.3

4 years ago

10.17.1-canary.2

4 years ago

10.18.1-canary.0

4 years ago

10.18.2-canary.0

4 years ago

10.17.1-canary.1

4 years ago

10.17.0

4 years ago

10.17.1-canary.0

4 years ago

10.16.1-canary.8

4 years ago

10.16.1-canary.7

4 years ago

10.16.1-canary.6

4 years ago

10.16.1-canary.5

4 years ago

10.16.1-canary.4

4 years ago

10.16.1-canary.3

4 years ago

10.16.1-canary.2

4 years ago

10.16.1-canary.1

4 years ago

10.16.1-canary.0

4 years ago

10.15.2-canary.4

4 years ago

10.15.2-canary.3

4 years ago

10.15.2-canary.2

4 years ago

10.15.1

4 years ago

10.15.1-canary.4

4 years ago

10.14.1

4 years ago

10.14.1-canary.7

4 years ago

10.13.0

4 years ago

11.0.0-alpha.11

4 years ago

11.0.0-alpha.10

4 years ago

11.0.0-alpha.9

4 years ago

11.0.0-alpha.6

4 years ago

11.0.0-alpha.7

4 years ago

11.0.0-alpha.8

4 years ago

11.0.0-alpha.5

4 years ago

11.0.0-alpha.3

4 years ago

11.0.0-alpha.4

4 years ago

11.0.0-alpha.2

4 years ago

11.0.0-alpha.1

4 years ago

11.0.0-alpha.0

4 years ago