Search the documentation

Type to search page titles, component names and descriptions.

    Layout

    Peek

    A non-modal first look at one item of a spatial view.

    import { Peek, PeekLayout } from 'faifo-design'

    Peek summarizes one record beside a spatial view such as a tape chart, a timeline or a board. The view stays interactive: picking another item replaces the content. PeekLayout docks the peek as a rail from 64rem and as a sheet over the lower part of the view below that.

    #When to use

    • Use it for the first look at an item when the reader will keep moving across the view.
    • Open the full record in a RecordPage or a ModalSheet when the reader starts editing.
    • Keep which record is peeked in the URL so the state survives a reload and Back.

    #Notes

    attachPeekInteractions (see Runtime) manages focus when an application island renders and replaces the peek.

    #Examples

    Each example is a specimen of the package catalogue, rendered on the server exactly as shown in its code.

    #Peek

    A non-modal summary beside a spatial view: picking another item replaces it. Shown embedded; docked, it stays in view and is a sheet on a phone.

    Show codeHide code
    import { ActionGroup, Badge, Button, DescriptionList, FormattedDate, FormattedMoney, Peek, PeekLayout, Stack, Surface } from 'faifo-design'
    
    export const Example = () => (
      <PeekLayout
        peekId="reservation-peek"
        mode="embedded"
        main={
          <Surface
            title="Room plan"
            body={
              <Stack
                items={[
                  <a href="#peek" aria-controls="reservation-peek">
                    Room 101 · R-1041 · Sam Lee
                  </a>,
                  <a href="#peek" aria-controls="reservation-peek" aria-current="true">
                    Room 102 · R-1042 · Alex Morgan
                  </a>,
                  <a href="#peek" aria-controls="reservation-peek">
                    Room 104 · R-1043 · Jordan Diaz
                  </a>,
                ]}
              />
            }
          />
        }
        peek={
          <Peek
            id="reservation-peek"
            eyebrow="R-1042"
            title="Alex Morgan"
            status={[
              <Badge label="Due in" tone="info" />,
              <Badge label="Deposit paid" tone="positive" />,
            ]}
            previous={{ label: 'Previous arrival', href: '#peek' }}
            next={{ label: 'Next arrival', href: null }}
            closeLabel="Close"
            closeHref="#peek"
            body={
              <Stack
                items={[
                  <DescriptionList
                    label="Stay"
                    columns={2}
                    items={[
                      { id: 'arrival', label: 'Arrival', value: <FormattedDate value="2026-09-04" /> },
                      {
                        id: 'departure',
                        label: 'Departure',
                        value: <FormattedDate value="2026-09-07" />,
                      },
                      { id: 'room', label: 'Room', value: '102 · Deluxe king' },
                      { id: 'guests', label: 'Guests', value: '2 adults' },
                    ]}
                  />,
                  <DescriptionList
                    label="Balance"
                    columns={2}
                    items={[
                      {
                        id: 'total',
                        label: 'Total',
                        value: <FormattedMoney value={7200000} currency="VND" />,
                      },
                      {
                        id: 'due',
                        label: 'Balance due',
                        value: <FormattedMoney value={4200000} currency="VND" />,
                      },
                    ]}
                  />,
                ]}
              />
            }
            actions={
              <ActionGroup
                actions={[
                  <Button label="Check in" variant="primary" />,
                  <Button label="Move room" variant="secondary" />,
                  <Button label="Take payment" variant="secondary" />,
                ]}
              />
            }
            record={{ label: 'Open reservation', href: '#record-page' }}
          />
        }
      />
    )

    #Client-owned Peek close

    The closeControl slot accepts a disposable client owner trigger. It remains a non-modal summary.

    Bank transactions

    Pick a transaction to inspect it.
    Show codeHide code
    import { Button, DescriptionList, Peek, PeekLayout, Surface } from 'faifo-design'
    
    export const Example = () => (
      <PeekLayout
        mode="embedded"
        peekId="client-peek"
        main={<Surface title="Bank transactions" body="Pick a transaction to inspect it." />}
        peek={
          <Peek
            id="client-peek"
            title="FT2628100002"
            body={
              <DescriptionList
                columns="auto"
                items={[{ id: 'amount', label: 'Amount', value: '5,400,000 VND' }]}
              />
            }
            record={{ label: 'Open reconciliation', href: '#record-page' }}
            closeLabel="Close"
            closeControl={<Button label="Client close" />}
          />
        }
      />
    )

    #Contract

    #Peek beside a spatial view

    Peek is a non-modal summary of one record docked beside the view it came from, inside a PeekLayout. It is not a dialog and not a drawer: there is no backdrop, the view stays interactive, and picking another item replaces the peek's content. Use it only where the reader scans many items in place (a tape chart, a timeline, a board) and needs a first look before choosing what to do; a list opens its records as a page or a modal instead.

    <PeekLayout
      peekId="reservation-peek"
      main={<RoomPlan />}          // invokers: aria-controls="reservation-peek", aria-current on the shown item
      peek={
        <Peek
          id="reservation-peek"
          eyebrow="R-1042"
          title="Alex Morgan"
          status={<Badge label="Due in" tone="warning" />}
          body={<DescriptionList label="Stay" columns={2} items={stay} />}
          actions={<ActionGroup label="Quick actions" actions={commands} />}
          record={{ label: 'Open reservation', href: reservationHref }}
          closeLabel="Close"
          closeHref="?view=all"                       // the peek lives in the URL
          previous={{ label: 'Previous arrival', href: '?view=all&peek=R-1041' }}
          next={{ label: 'Next arrival', href: null }} // end of the run: disabled, not a dead link
        />
      }
    />
    • Anatomy. The head holds the eyebrow (code or kind), the title (h2, wraps rather than hiding the part that tells two records apart), the status badges and the tools: previous, next, the record (expand icon) and close. The tools keep the action target size; their glyphs use the small icon size so the title leads. The body is a summary only: description lists and short notes, never editable fields. The foot holds the commands for the record's state, on one row; it is omitted when there are none and while loading.
    • Commands are two or three, at most one primary, and open the flow or nested dialog that does the work. The peek itself never saves.
    • The record is always reachable, also while the summary loads or fails: the expand tool opens the record's page (or its modal), carrying the reader's way back.
    • URL. The peeked record is a query parameter (by convention peek=<id>). Opening pushes a history entry, moving to another item (an invoker or the pager) replaces it, closing pushes; Back and Forward restore the peek without writing. Close is then a link to the URL without peek; without a URL it is a button.
    • Loading shows the frame with the title the reader picked and a Skeleton, so the rail keeps its place; status and commands wait for the record. An error is a Notice with a retry in the body; a record that no longer exists is an answer (an informational notice), not an error. Cache recent summaries and read ahead on hover/focus of an invoker so opening is usually complete.
    • Layout. From 64rem the peek is a rail of --faifo-right-rail-width beside the view, one --faifo-layout-gap away, sticky in the viewport. Below 64rem (a tablet beside the shell's sidebar, or a phone) it is a sheet over the lower part of the view, capped at --faifo-peek-sheet-max-height (60dvh), and the view keeps that much scroll room under its last row. mode="embedded" lays it out in place, for documentation and catalogue specimens.
    • Focus and keys (attachPeekInteractions(layout), attach once per layout from the island that renders the peek): opening from an invoker moves focus to the panel; a page that loads with the peek open, or a peek restored by history, leaves focus alone. Another invoker replaces the content without moving focus; the heading is a polite live region, so the new record is announced. Escape closes through the close control unless a dialog or popup above owns it. When the reader closes the peek, focus returns to the item it showed (after paging, not the first invoker); when the application closes it, only if focus would otherwise be lost. Where the peek is a sheet, the invoker is scrolled out from under it.
    • Invokers carry aria-controls naming peekId, and the shown item aria-current="true". PeekLayout puts that id on the peek's place, which stays in the DOM while no peek is open, so the reference resolves in every state; the Peek inside takes the same id as the stem of its title and close ids and carries no id of its own.

    #API

    Generated from the package source. A property without a description has none in the source yet.

    #PeekComponent

    A non-modal summary of one record, docked beside a spatial view (tape chart, timeline, board) in a PeekLayout. The view stays interactive: picking another item replaces the peek's content. It is a first look, not an editor: commands open nested dialogs, and record opens the full record.

    PropertyDescriptionTypeDefault
    idrequiredThe peekId of the PeekLayout it sits in: the stem of the title and close control ids. Invokers name the layout's place with aria-controls, which keeps the id while no Peek is open.string–
    titlerequired–string–
    eyebrowThe record's code or kind, above the title.string | null–
    statusBadges for the record's state, under the title.JSXChild–
    bodyrequiredA summary only: description lists, short notes. No editable fields.JSXChild–
    actionsTwo or three commands for this state, at most one primary. They open nested dialogs.JSXChild–
    recordrequiredA peek always leads to the full record: its page (or modal) is where the work happens. It is the expand tool in the head, beside close, so the commands keep the whole foot.{ label: string; href: string }–
    closeLabelrequired–string–
    closeHrefA link when the peek is in the URL (peek=<id>); without it the close control is a button.string | null–
    closeControlA CSR owner may wrap the public close action in its own state trigger.JSXChild–
    previous–PeekStep | null–
    next–PeekStep | null–
    loadingShows the frame with a skeleton body while the record's summary loads, so the panel keeps its place and width; the title comes from the invoker the user picked.{ label: string } | null–

    #PeekLayoutComponent

    Docks a Peek beside its view from 64rem, and over its lower part below that.

    PropertyDescriptionTypeDefault
    peekIdrequiredThe id of the peek's place, which stays in the DOM while no Peek is open, so invokers in main can name it with aria-controls in every state. The Peek inside takes it as id.string–
    mainrequiredThe spatial view.JSXChild–
    peekThe Peek, or the island that renders it. Hidden while it holds no Peek.JSXChild–
    modedocked (default) keeps the peek in view beside the work, and makes it a sheet over the lower part of the view below 64rem (tablet and phone). embedded lays it out in place, for documentation and catalogue specimens.'docked' | 'embedded''docked'

    #Types

    #PeekLayoutProps

    The properties of PeekLayout, listed above.

    #PeekProps

    The properties of Peek, listed above.

    #PeekStep

    A step to the previous or next record of the same view; href: null is the end of the run.

    PropertyDescriptionTypeDefault
    labelrequired–string–
    hrefrequired–string | null–

    #Hooks

    The data-ui values these components render. Select them in tests and behaviour; their look belongs to the design system. See Contract.

    • peek-layout
    • peek-layout-main
    • peek-layout-aside
    • peek
    • peek-head
    • peek-heading
    • peek-eyebrow
    • peek-title
    • peek-status
    • peek-tools
    • peek-body
    • peek-foot
    • peek-actions