Soracom

Design System
  1. Home
  2. Design system
  3. Elements
  4. Text

Text

Text is a general component for styling text content.

Options

Basic usage

Basic content example

html
Copy

Mixed content example

html
Copy

Longer content example

html
Copy

HTML P defaults

SDS sets the standard html paragraph element (P) to a default style.

SampleElement

空色 Sky blue

P

Size classes

html
Copy

Available classes are listed below:

Note: 1rem == 10px

SampleClass
空色 Sky blue--4xhuge
空色 Sky blue--3xhuge
空色 Sky blue--2xhuge
空色 Sky blue--xhuge
空色 Sky blue--huge
空色 Sky blue--4xlarge
空色 Sky blue--3xlarge
空色 Sky blue--2xlarge
空色 Sky blue--xlarge
空色 Sky blue--large
空色 Sky blue--medium
空色 Sky blue--small
空色 Sky blue--xsmall
空色 Sky blue--2xsmall
空色 Sky blue--3xsmall
空色 Sky blue--4xsmall

Visual states

html
Copy

Component color

Basic content example

html
Copy

Icons

You can include an icon at the beginning of a ds-text element by simply including an icon class:

html
Copy

If you need more control over the size, color or location of the icon, you can use an Icon component:

html
Copy

Longer content example

html
Copy

Longer content example

html
Copy

Notification indicators

Text can display a notification indicator (dot) by adding the class --notification.

html
Copy

Longer content example

html
Copy

Notification indicators adhere to 4x preset visual states - alert, warning, success and info.

html
Copy

Additionally, if the label has an attribute data-notification-counter set to a non-empty value, that value will be shown in the indicator. If the attribute is set to empty data-notification-counter="" the indicator dot will be hidden.

html
Copy

Text inside other components

When ds-text is used inside ds-select, ds-input, ds-button or ds-range it will be displayed next to the element and will not wrap when the window is scaled.

html
Copy

Addon text

The --addon styles slightly modify the text to ‘join’ the containing component.

Addon default style

html
Copy

Addon light style

With --addon-light style:

html
Copy

Addon dark style

With --addon-dark style:

html
Copy

Styles

Custom styles exist for specific use cases.

Inset style

.ds-text --inset matches the padding (inset) of ds-input. This is useful for alignment when creating inplace editing components, or alignment when adjacent to other fields.

html
Copy

Label style

Style text to look like a label

html
Copy
html
Copy
html
Copy

Code style

Use mono-space Source Sans Code font

html
Copy

Html anchors a with the class --link will automatically be styled as links with an appropriate icon appened.

Use mono-space Source Sans Code font

html
Copy

Fee style

html
Copy
html
Copy

Tests

HTML text sizes

html
Copy

All text sizes

html
Copy

Manifest

The component manifest describes this component's API — its modifiers, structure, data attributes, CSS custom properties, accessibility notes, and example markup. It is consumed by tooling such as AI assistants and code generators.

Latest version: https://assets.soracom.io/sds/latest/ds-rows/index.mjs

index.mjs
Copy