Components

One design system, drawn natively everywhere

Every OpenVibe component is described by what it is: its parts, the tokens they wear, its states, and how it reads to a screen reader. The web draws it with the kit; an Android or iOS app draws the same component with its own views, so an app is never a web page in a frame.

Card

One thing, the same anatomy everywhere: a stream, a clip, a listing, a game, a paste. The whole card is one link.

Parts and their tokens

  • mediabackgroundcolor.bg.hoverradiusradius.mdin the type's shape (16:9 streams and clips, 1:1 listings and memes, 4:3 games and reports); a picture, a text preview or the type's icon
  • badge optionalbackgroundrgba(0,0,0,.74)color#ffftop left, one word; LIVE is color.status.live.base
  • corner optionalbottom right: a length or a price
  • titlecolorcolor.text.primarysizetype.size.bodyweighttype.weight.boldtwo lines at most
  • sub optionalcolorcolor.text.secondarysizetype.size.metaone plain line
  • meta optionalcolorcolor.text.mutedsizetype.size.metawho · one count · when; a count of 0 is left out
  • more optionalthe ⋯ menu: Save, Remind, Share

How it behaves

Role
article with a heading link
Props
href* title* type ratio image alt badge live corner sub preview who avatar count when level * required
States
default · hover (the picture zooms, the peek shows) · focused · live
Name
its title (the heading's link)
Keys
Tab to the card, Enter opens it; the menu is its own stop
Target
the whole card
Phone
about 1.2 to a rail, swiped
Computer
a fixed width in a rail, or a grid
type
stream 16:9, a LIVE badge when live
clip 16:9 with its length
listing 1:1 with its price
game 4:3
post 16:9, a text preview when it has no picture

Code

Jetpack Compose, on the theme file from Tokens (Android): Material 3 roles for colour, OvScale for sizes.

// OpenVibe kit for Jetpack Compose: add the theme file from openvibe.design/tokens (Android) and wrap the app in
// MaterialTheme(colorScheme = if (isSystemInDarkTheme()) VibeDarkColorScheme else VibeLightColorScheme) { … }
enum class OvKind { Primary, Quiet, Danger }
enum class OvNoticeKind { Ok, Info, Warn, Error }

@Composable
fun OvCard(title: String, onOpen: () -> Unit, image: String? = null, ratio: Float = 16f / 9f, badge: String? = null, sub: String? = null, meta: String? = null) {
    val c = MaterialTheme.colorScheme
    Column(Modifier.clickable(onClickLabel = title, onClick = onOpen).semantics(mergeDescendants = true) { heading() }) {
        Box(Modifier.fillMaxWidth().aspectRatio(ratio).clip(RoundedCornerShape(OvScale.RadiusMd)).background(c.surfaceVariant)) {
            if (image != null) AsyncImage(image, contentDescription = null, Modifier.matchParentSize(), contentScale = ContentScale.Crop)
            if (badge != null) Text(badge, Modifier.padding(OvScale.SpaceSm).background(Color(0xBD000000), RoundedCornerShape(6.dp)).padding(horizontal = 8.dp), color = Color.White, fontWeight = FontWeight.ExtraBold, fontSize = 11.sp)
        }
        Spacer(Modifier.height(OvScale.SpaceMd))
        Text(title, color = c.onSurface, fontWeight = FontWeight.Bold, fontSize = OvScale.TypeSizeBody, maxLines = 2, overflow = TextOverflow.Ellipsis)
        if (sub != null) Text(sub, color = c.onSurfaceVariant, fontSize = OvScale.TypeSizeMeta, maxLines = 1)
        if (meta != null) Text(meta, color = c.onSurfaceVariant, fontSize = OvScale.TypeSizeMeta, maxLines = 1)
    }
}

Shared interfaces

Web, Android and iOS definitions for the navigation, composer, sheets, settings and motion used across OpenVibe. See the whole registry, or read it as JSON at /api/v1/components.

Kit documents: screens as data

A screen can be sent as a tree of these components, for example { "type": "rail", "children": [{ "type": "card", … }] }. Every OpenVibe client renders the same document with its own views, so a screen can change without an app release (the server-driven UI pattern of Airbnb and DivKit). Documents are checked strictly: known components and props only, typed values, which children each takes, a size limit, and https or same-site links.

The specs as JSON The tokens they wear