datui
Color scheme

Data display

HorizontalCell

Vertical tile — media on top, text below — for horizontally scrolling lists.

import { HorizontalCell, HorizontalCellShowMore } from "datui";

Playground

Album 24 photos
<HorizontalCell title="Album" subtitle="24 photos" size="s" />

Examples

Show more tile

HorizontalCellShowMore ends a scrolling row with a link to the full list.

Sizes

Token widths s–xl, auto, or a number of pixels.

Accessibility

  • With onClick or href the tile renders a <button> or <a> named by its title and subtitles; Enter/Space activate.
  • Put tiles in a <ul> with each one in an <li> when they form a list.
  • Give media meaningful alt text, or an empty alt when the title already names it.

API

HorizontalCell

Vertical tile (media on top, text below) for horizontally scrolling lists.

PropTypeDefaultDescription
activatedboolean—Keep the pressed look, e.g. for the active item of a list.
asElementType<any, keyof IntrinsicElements>—Element to render. Defaults to `a` with `href`, `button` with `onClick`, otherwise `div`.
classNamestring—
disabledboolean—
extraSubtitleReactNode—
hrefstring—
noPaddingbooleanfalseRemove the inner padding.
relstring—
sizenumber | "s" | "auto" | "m" | "l" | "xl"sTile width: a token size, `auto` (fits content) or a number of px.
subtitleReactNode—
targetstring—
textAlign"center" | "start" | "end"size === "s" ? "center" : "start"Text alignment. Defaults to `center` for size `s`, otherwise `start`.
titleReactNode—Text under the media.
titleAsElementType<any, keyof IntrinsicElements>spanElement for the title.
type"button" | "submit" | "reset"—

HorizontalCellShowMore

"Show all" tile placed after the last `HorizontalCell` of a scrolling list.

PropTypeDefaultDescription
activatedboolean—Keep the pressed look, e.g. for the active item of a list.
asElementType<any, keyof IntrinsicElements>—Element to render. Defaults to `a` with `href`, `button` with `onClick`, otherwise `div`.
centeredbooleanfalseCenter the tile vertically in the row.
classNamestring—
disabledboolean—
heightnumber64Height of the icon area in px, usually the neighbouring media height.
hrefstring—
relstring—
size"s" | "m"sMatch the neighbouring `HorizontalCell` width.
targetstring—
type"button" | "submit" | "reset"—