@hanzo/ui

DetailPane

import { useDetailPane, DetailPane, PaneBar, PaneBody, PaneFoot, usePane, PANE } from '@hanzo/ui/product'

No examples yet.

Types

export type DetailDescriptor = {
  /** Pane title (the item's name). */
  title: ReactNode
  /** Optional secondary line under the title (type, id, status…). */
  subtitle?: ReactNode
  /** Optional title icon, tinted with `iconColor`. */
  icon?: IconLike
  iconColor?: string
  /** Desktop pane width (px), overlay mode. Mobile is always full-screen. Default 460 (400 in the record frame). */
  size?: number
  /** The body — the detail view or edit form for the item. */
  content: ReactNode
  /** Optional sticky footer (primary actions), pinned below the scroll body. */
  footer?: ReactNode
  /** The page's own actions, in the top bar before expand and close (record frame). */
  actions?: ReactNode
  /** Opens the page on the main surface: shows the expand button and binds ⌘/Ctrl+Enter. */
  onExpand?: () => void
  /** The expand button's tooltip. Default "Open". */
  expandLabel?: string
  /** The page draws its own frame from `PaneBar` / `PaneBody` / `PaneFoot` (a command menu, a search). */
  bare?: boolean
}
export type DetailPaneApi = {
  /** A new stack, holding this page. */
  open: (descriptor: DetailDescriptor) => void
  /** This page over the current one. Opens the pane when it is shut. */
  push: (descriptor: DetailDescriptor) => void
  /** Off the top: the page under it shows. On the last page, the pane closes. */
  back: () => void
  close: () => void
  isOpen: boolean
  /** How many pages the stack holds; a back button shows while it is more than one. */
  depth: number
}
export type DetailPaneProps = {
  children: ReactNode
  /** z-index for stacking — a pane opened over another overlay passes a
   *  higher value. Left to `SlideOver`'s own default otherwise. */
  zIndex?: number
  /** `overlay` (default) floats above the page; `docked` is a column in the layout beside it. */
  mode?: 'overlay' | 'docked'
  /** Where a docked pane keeps the width a person chose (localStorage key). */
  store?: string
}
export type PaneBarProps = {
  /** The leading cluster after the back button: an icon and a title, or a search field. */
  children?: ReactNode
  /** The page's own actions, before expand and close. */
  actions?: ReactNode
}

Exports

useDetailPaneDetailPanePaneBarPaneBodyPaneFootusePanePANEtype DetailDescriptortype DetailPaneApitype DetailPanePropstype PaneBarProps