Skip to content

View modes ​

The ways one library can show its records (list, grid, table, map or pipeline) and the switch people use to move between them.

library-baselibrary--view-switchOpen in Storybook ↗

When to use ​

  • A list of records where people do different jobs with the same results: scanning titles, looking at images, comparing values, seeing where things are, following a flow.
  • The record type allows more than one mode. With one allowed mode there is no switch.

When not to use ​

Anatomy ​

  1. View switch: icon buttons (--view-switch-size) in one capsule with a --color-border-default border, --radius-input corners and a --color-surface fill. The active mode has --color-accent-wash behind a --color-accent-ink icon; the others are --color-text-secondary and get --color-surface-row-hover on hover. Each button has a tooltip with its name. The switch ends the results band, after search, page size and sort.
  2. Card size switch: only in grid mode, right after the view switch. Two text buttons, Large and Compact (--view-switch-text-pad), in the same capsule style.
  3. Results area: the chosen mode, under the band and the selection action bar.

The buttons appear in the order the record type lists its modes.

Variants ​

ModeWhat it showsWhen to use itPager
Listone row per record, fields side by sidethe default for most listsyes
Grid, largecards with square media, the title and the fieldsmedia-heavy listsyes
Grid, compactcards with media and the title only, more per rowscanning many imagesyes
Tablefixed columns under a header row; can be grouped by a fieldcomparing values across recordsyes, except when grouped
Mapthe records as points, shapes or a heat maprecords with a locationno: loads up to 1,000 records
Pipelinethe records as cards in a left-to-right flow, joined along their relationsrecords that feed each other, such as work, expression and manifestationno: loads up to 1,000 records

List ​

library-baselibrary--listOpen in Storybook ↗

The rows are described on the entity list element page.

Grid ​

library-baselibrary--gridOpen in Storybook ↗
library-baselibrary--grid-compactOpen in Storybook ↗

Large cards are at least --grid-card-min-width wide, compact cards --grid-card-min-width-compact. Compact cards drop the fields and keep the image and the title. On wide screens a Select page row sits above the cards.

Table ​

library-baselibrary--tableOpen in Storybook ↗

The table needs every record on the page to have the same fields. When they differ, the Table view button is left out and the list shows instead. In table mode the sort controls also offer Group by when the list has group options; a grouped table shows the records under a header per group, each with its own load more, and hides the pager.

Map ​

library-baselibrary--mapOpen in Storybook ↗

The record type sets the map kind: points, shapes (WKT) or a heat map, and optionally the centre, zoom, a standard or satellite base map and an area filter. The map loads up to 1,000 records (a heat map: all of them) instead of one page; leaving the map goes back to pages of 20. The map itself is described on the map viewer page.

Pipeline ​

library-baselibrary--pipelineOpen in Storybook ↗

The record type names the relations that join the cards. A card links to another only when both are in the results; cards without a relation stand alone in the first column. Drag the canvas to move around; the −, + and Fit buttons in the corner zoom. Nothing about the layout is saved. Pickers never offer the pipeline.

States ​

StateWhat you seeTrigger
One modeno view switch; the one mode showsthe record type allows one mode
Several modesthe view switch, the active mode in accent washthe record type allows more than one
Rememberedthe mode last chosen in any library opensa list, grid, table or pipeline choice in this browser
Table not possibleno Table view button; the list showsrecords on the page have different fields
Gridthe card size switch next to the view switchgrid mode
Loadingskeleton rows; the map shows a spinner over the map; the pipeline shows grey card shapesfetching

Which mode opens:

  1. If the record type allows one mode, that mode.
  2. Otherwise the list, grid, table or pipeline last chosen in this browser, if this list allows it.
  3. Otherwise the list, or the first mode in the switch when the list is not allowed.

The map is never remembered: it always opens from the switch. The card size is remembered per browser, apart from the mode. The entity picker has the same switch, without the pipeline, and does not remember a choice. The search window and the picker in a guided flow step always open as a list.

Keyboard & accessibility ​

  • Tab reaches each button in the view switch, then the card size buttons. Enter or Space picks a mode.
  • The view switch is a role="group" named View; each button has aria-pressed and a name such as List view or Map view. The tooltip also opens on focus.
  • The card size switch is a role="group" named Card size, with aria-pressed on Large and Compact.
  • In the pipeline, the zoom buttons are named Zoom out, Zoom in and Fit.
  • On narrow screens the band wraps; the switches stay last, after the sort controls. Below 48rem the column header rows of the list and the table are replaced by the small-screen row with Select page and the count.

Content ​

  • Button names end in view: List view, Grid view, Table view, Map view, Pipeline view.
  • Translation keys: library.view-mode, library.view-modes.*, library.grid-size.*, library.group-by, pipeline.*.

Entity list element · Selection action bar · Filter panel · Map viewer · Preview panel · Entity picker

Powered by Elody - Open Source Semantic Data Platform