Skip to content

NbWireframe draws a schematic thumbnail of a layout: bars for copy, pills for buttons, boxes for media, on a 12-column grid. Use it where someone has to pick a layout before it exists, such as a block picker or a template gallery. A name and a description cannot show a shape at a glance, and a wireframe can.

The spec is data, not markup, so it can come from anywhere (a site's registry, a server) without the host rendering anything it did not write.

vue
<template>
  <NbWireframe
    label="Product hero"
    :spec="{
      rows: [
        [
          { span: 7, parts: ['eyebrow', 'title', 'text', 'buttons'] },
          { span: 5, parts: ['image'] },
        ],
      ],
    }"
  />
</template>

Rows, columns and counts ​

A spec is rows of columns. Each column spans part of the 12-column grid and lists its parts from top to bottom. A part can carry a count after a colon.

A picture never takes more than part of the frame's height, so whatever sits under it (a caption, a button) stays in view.

Parts ​

PartDrawsCount
eyebrowa short accent bar
titlea heavy headline bar
headinga section heading bar
textlines of body copy2
buttonsa primary and a secondary button
buttonone primary button
imagea picture
devicea screen in a frame
chipssmall pills3
tabspills, the first one active3
badgeone small pill
cardscards with a heading and text3
tilesplain tiles4
listbulleted lines3
linksplain lines3
inputa field with a button
quotea pull quote
logoa mark and a name
icona small square
dividera rule

An unknown part is ignored rather than refused, so a spec written for a newer version of the library still draws on an older one.

Accessibility ​

Without a label the wireframe is decorative (aria-hidden). With one it is an image with that name. Give it a label when nothing next to it already names the layout.

Props ​

PropTypeDefaultDescription
specIWireframeSpecrequiredThe layout: { tone?, rows: IWireframeColumn[][] }
labelstringundefinedAccessible name. Without it the drawing is decorative

Types ​

ts
interface IWireframeSpec {
  tone?: 'light' | 'dark'
  rows: IWireframeColumn[][]
}

interface IWireframeColumn {
  span?: number // of 12, defaults to an equal share of the row
  parts: string[] // e.g. 'title', 'cards:3'
  align?: 'start' | 'center' | 'end'
}