Skip to Content
Documentation

Text and media

The components of songstress/ui for text and media, each as Songstress draws it, with its props and an example.

What a person reads and sees: text in its styles, prose, icons, pictures, a playing sprite, covers, and the small parts that say how things stand.

Each picture is the SDK’s own test tree for the component, drawn by the web app; every app draws the same tree with its own controls, the phones natively. Each example is the one in the SDK’s doc comment, which its tests compile, and the props are read from its types.

Text

Text in each style: a title, a heading in the accent tone, body, a caption, a label and codeText in each style: a title, a heading in the accent tone, body, a caption, a label and code

Words, in one of six styles: a text node. Its words are its children, or text.

Example: Text
import { Text } from 'songstress/ui'

const title = <Text style="title">Played lately</Text>
const note = <Text tone="muted" lines={2}>{`${12} songs, the last one an hour ago`}</Text>

In the reference: Text.

Prop

Type

ProseText

Prose: a paragraph with emphasis, a list and a linkProse: a paragraph with emphasis, a list and a link

Prose: paragraphs, lists and emphasis in the manifest's prose format, a prose node. Its blocks are blocks, or its children's text a block a line, as the format has it: a paragraph, a heading or a list item is one line, and a blank line is nothing.

Example: ProseText
import { ProseText } from 'songstress/ui'

const about = <ProseText blocks={['Counts each song you play to the end.', 'Nothing leaves your server.']} />

In the reference: ProseText.

Prop

Type

Glyph

Three icons from Songstress’s set, in their sizes and tonesThree icons from Songstress’s set, in their sizes and tones

An icon, by name, from Songstress's icon set: an icon node.

Example: Glyph
import { Glyph } from 'songstress/ui'

const mark = <Glyph name="headphones" tone="accent" size="small" />

In the reference: Glyph.

Prop

Type

Image

Images in their shapes: a cover from the library, an address that did not load, and the package’s own image of frames, wholeImages in their shapes: a cover from the library, an address that did not load, and the package’s own image of frames, whole

A picture: an image node, a cover of the library, an address the app fetches through the server, or one of the package's own images.

Example: Image
import { Image } from 'songstress/ui'

// An image the package carries, by its path in the package.
const header = <Image source={{ asset: 'images/header.png' }} description="The radio's logo" shape="wide" />

In the reference: Image.

Prop

Type

Sprite

Sprites of the package’s own image, each playing one row of framesSprites of the package’s own image, each playing one row of frames

One row of an image of frames, played: a sprite node.

Example: Sprite
import { Sprite } from 'songstress/ui'

// Eight frames of 32 points in a row of the package's own image, twelve a second.
const bars = <Sprite source={{ asset: 'images/bars.png' }} frameWidth={32} frameHeight={32} frames={8} rate={12} loop description="Bars that move" />

In the reference: Sprite.

Prop

Type

Cover

The covers of an album, an artist, a song and a playlist from the libraryThe covers of an album, an artist, a song and a playlist from the library

The cover of something in the library: a cover node.

Example: Cover
import { Cover } from 'songstress/ui'

const art = <Cover of="album" id="al-1" size="large" description="Kind of Blue" />

In the reference: Cover.

Prop

Type

Badge

A badge reading BetaA badge reading Beta

A short word in a pill: a badge node. Its words are its children, or text.

Example: Badge
import { Badge } from 'songstress/ui'

const fresh = <Badge tone="success">New</Badge>

In the reference: Badge.

Prop

Type

Progress

Progress as a bar with its label, as a ring, and with no telling how farProgress as a bar with its label, as a ring, and with no telling how far

How far something has got, as a bar or a ring: a progress node.

Example: Progress
import { Progress } from 'songstress/ui'

const imported = <Progress value={0.4} label="40 of 100 songs" />
const going = <Progress variant="ring" label="Looking" />

In the reference: Progress.

Prop

Type

Callout

A callout across the top of a block: All syncedA callout across the top of a block: All synced

A banner: a notice across the top of a block, in a tone, with one button at most: a banner node. Its button is buttonTitle and onPress.

Example: Callout
import { Callout } from 'songstress/ui'

const down = <Callout tone="warning" title="The lyrics service is down" text="Lyrics come back when it does." buttonTitle="Try again" onPress={{ type: 'refresh' }} />

In the reference: Callout.

Prop

Type

Empty

Two empty states: Nothing played yet, and No resultsTwo empty states: Nothing played yet, and No results

The app's "nothing here": an empty node. Its button is buttonTitle and onPress.

Example: Empty
import { Empty } from 'songstress/ui'

const none = <Empty title="Nothing played yet" text="Play a song to the end, and it shows here." icon="music" />

In the reference: Empty.

Prop

Type

Skeleton

Skeletons of a line of text, a row, a card and an image, as the app shows them while something loadsSkeletons of a line of text, a row, a card and an image, as the app shows them while something loads

The app's placeholder while something loads: a skeleton node.

Example: Skeleton
import { Skeleton } from 'songstress/ui'

const loading = <Skeleton shape="row" count={3} />

In the reference: Skeleton.

Prop

Type

On this page