App shell

Peek

Open a page without leaving the current one: the side peek docked at the right edge, or the center peek modal. Both share the top bar and body parts.

Sidebar rebuild

Due
October 9, 2026
Priority
High
Status
Empty
Comments
A
Press ‘enter’ to continue with an empty page.

Usage

  • Use a side peek to preview a page or record while keeping the list beside it usable.
  • Use a center peek when the preview should take focus (modal) but the user stays in context.
  • Offer “Open in full page” for long content; peeks are for quick reads and edits.
  • Don’t stack peeks; replace the content (Previous / Next) instead.
  • Don’t use a peek for confirmations or short forms; use Dialog / ConfirmDialog.

Installation

Install the package (React 19):

terminal
npm install @krackedui/motion

Import the styles once, in your app entry or root layout:

/src/main.tsx
import '@krackedui/motion/styles.css';

Use it anywhere inside your app's <Theme> (see Installation):

/src/PeekExample.tsx
import { useState } from 'react';
import { SidePeek, PeekBody, PeekProperties, PeekProperty, PeekComments, PageHeader, Button } from '@krackedui/motion';

export function PeekExample() {
  const [open, setOpen] = useState(true);

  return (
    <div className="relative h-[640px] bg-n-bg-secondary">
      <Button variant="secondary" onClick={() => setOpen(true)}>Open side peek</Button>
      <SidePeek open={open} width={660} onClose={() => setOpen(false)} onSwitchMode={() => console.log('Switch to center peek')}>
          <PeekBody
            header={<PageHeader size="peek" title="Sidebar rebuild" extraControls={null} />}
            properties={
              <PeekProperties>
                <PeekProperty icon="calendarDate15" label="Due">October 9, 2026</PeekProperty>
                <PeekProperty icon="arrowInCircleDown" label="Priority">High</PeekProperty>
                <PeekProperty icon="checkmarkCircle" label="Status" />
              </PeekProperties>
            }
            comments={<PeekComments />}
          >
            <div className="pl-2 text-n-text-tertiary">Press ‘enter’ to continue with an empty page.</div>
          </PeekBody>
      </SidePeek>
    </div>
  );
}

Examples

Center peek

Peek top bar

Database row in a peek

Use PropertyList for editable database properties.

Sidebar rebuild

Status
Priority
Team
Due
Comments
A

Composition

anatomy
<SidePeek>  |  <CenterPeek open onOpenChange>
  <PeekTopBar/>              // built in: Close · Open in full page · (hover) Switch peek mode · Previous / Next · actions
  <PeekBody header properties comments gutter>
    header      → <PageHeader size="peek"/>
    properties  → <PeekProperties> <PeekProperty/> × n </PeekProperties>   (or <PropertyList/> for databases)
    comments    → <PeekComments/>
    children    → page body
  </PeekBody>
</SidePeek>

API Reference

SidePeek

Based on a non-modal <dialog open> (except title). Also takes the PeekTopBar callbacks.

PropTypeDefault
open
boolean
true
label
string
"Page preview"
autoFocus
boolean
true
width
number
660
minWidth
number
400
maxWidth
number
1200
onClose
() => void
onOpenFull
() => void
onSwitchMode
() => void
onPrev
() => void
onNext
() => void
actions
ReactNode
children
ReactNode

CenterPeek

PropTypeDefault
open
boolean
onOpenChange
(open: boolean) => void
title
string
"Page"
onClose
() => void
onOpenFull
() => void
onSwitchMode
() => void
onPrev
() => void
onNext
() => void
actions
ReactNode
children
ReactNode
className
string

PeekTopBar

PropTypeDefault
mode
"side""center"
"side"
onClose
() => void
onOpenFull
() => void
onSwitchMode
() => void
onPrev
() => void
onNext
() => void
actions
ReactNode

PeekBody

Based on <div> (except title).

PropTypeDefault
header
ReactNode
properties
ReactNode
comments
ReactNode
children
ReactNode
gutter
number
76

PeekProperties

Based on <div>. Table wrapper + "Add a property".

PropTypeDefault
onAddProperty
() => void

PeekProperty

Based on <div>. Static property row.

PropTypeDefault
icon
IconName
"textNormal"
label
ReactNode
children
ReactNode
empty
ReactNode
"Empty"

PeekComments

Based on <div> (except onSubmit).

PropTypeDefault
avatar
ReactNode
letter avatar
placeholder
string
"Add a comment…"
onSubmit
(text: string) => void
children
ReactNode

Accessibility

  • Side peek: a non-modal dialog (aria-modal="false", labelled by label, default "Page preview"). Focus moves into it on open and returns to the opener on close; Escape inside it closes it (onClose). The left-edge resize handle is a "Preview width" slider: ←/↑ widen, →/↓ narrow (20px), Page Up/Down 100px, Home/End jump to minWidth/maxWidth.
  • Center peek: Radix Dialog with a visually hidden title; focus is trapped, Escape and the underlay close it, focus returns to the trigger.
  • Top bar buttons have labels and titles (Close, Open in full page, Switch peek mode, Previous page, Next page); the hover-only group also appears on focus.
  • Comments: the input is labelled by its placeholder, Enter sends; Attach, Mention and Send are labelled buttons.
  • Both slide / scale in and out (disabled under reduced motion) and are full-screen on phones.
© 2026 Motion. Internal documentation.