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


Words, in one of six styles: a text node. Its words are its children, or 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: 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.
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


An icon, by name, from Songstress's icon set: an icon node.
import { Glyph } from 'songstress/ui'
const mark = <Glyph name="headphones" tone="accent" size="small" />In the reference: Glyph.
Prop
Type
Image


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.
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


One row of an image of frames, played: a sprite node.
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 cover of something in the library: a cover node.
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 short word in a pill: a badge node. Its words are its children, or text.
import { Badge } from 'songstress/ui'
const fresh = <Badge tone="success">New</Badge>In the reference: Badge.
Prop
Type
Progress


How far something has got, as a bar or a ring: a progress node.
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 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.
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


The app's "nothing here": an empty node. Its button is buttonTitle and onPress.
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


The app's placeholder while something loads: a skeleton node.
import { Skeleton } from 'songstress/ui'
const loading = <Skeleton shape="row" count={3} />In the reference: Skeleton.
Prop
Type