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
onClickorhrefthe 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
alttext, or an emptyaltwhen the title already names it.
API
HorizontalCell
Vertical tile (media on top, text below) for horizontally scrolling lists.
| Prop | Type | Default | Description |
|---|---|---|---|
| activated | boolean | — | Keep the pressed look, e.g. for the active item of a list. |
| as | ElementType<any, keyof IntrinsicElements> | — | Element to render. Defaults to `a` with `href`, `button` with `onClick`, otherwise `div`. |
| className | string | — | |
| disabled | boolean | — | |
| extraSubtitle | ReactNode | — | |
| href | string | — | |
| noPadding | boolean | false | Remove the inner padding. |
| rel | string | — | |
| size | number | "s" | "auto" | "m" | "l" | "xl" | s | Tile width: a token size, `auto` (fits content) or a number of px. |
| subtitle | ReactNode | — | |
| target | string | — | |
| textAlign | "center" | "start" | "end" | size === "s" ? "center" : "start" | Text alignment. Defaults to `center` for size `s`, otherwise `start`. |
| title | ReactNode | — | Text under the media. |
| titleAs | ElementType<any, keyof IntrinsicElements> | span | Element for the title. |
| type | "button" | "submit" | "reset" | — |
HorizontalCellShowMore
"Show all" tile placed after the last `HorizontalCell` of a scrolling list.
| Prop | Type | Default | Description |
|---|---|---|---|
| activated | boolean | — | Keep the pressed look, e.g. for the active item of a list. |
| as | ElementType<any, keyof IntrinsicElements> | — | Element to render. Defaults to `a` with `href`, `button` with `onClick`, otherwise `div`. |
| centered | boolean | false | Center the tile vertically in the row. |
| className | string | — | |
| disabled | boolean | — | |
| height | number | 64 | Height of the icon area in px, usually the neighbouring media height. |
| href | string | — | |
| rel | string | — | |
| size | "s" | "m" | s | Match the neighbouring `HorizontalCell` width. |
| target | string | — | |
| type | "button" | "submit" | "reset" | — |