Components

PeekIn

PeekIn is a full-screen immersive overlay for focused, in-context tasks.

PeekIn is a full-screen immersive overlay used to surface a focused task or detailed view without navigating away from the current context. Trigger it from anywhere, then compose its contents from PeekInHeader, PeekInContent, an optional PeekInFooter, and an optional PeekInPanel side rail.

Open/closed state is controlled with the open prop and reported back through onOpenChange.

Give the overlay an accessible name with aria-label. It is derived from PeekInHeader's title when that is a plain string, so aria-label is required whenever the title is composed of elements rather than text.

import { PeekIn,PeekInHeader,PeekInContent,PeekInFooter,PeekInPanel } from '@sproutsocial/racine'
() => {
const [open, setOpen] = useState(false)
return (
<Box>
<Button appearance='primary' onClick={() => setOpen(true)}>
Open PeekIn
</Button>
<PeekIn open={open} onOpenChange={setOpen} closeButtonAriaLabel='Close'>
<PeekInHeader title='Post Analytics' subtitle='Last 30 days' />
<PeekInContent>
<Text.BodyCopy as='p'>
Main content — charts, graphs, or post details go here.
</Text.BodyCopy>
</PeekInContent>
<PeekInFooter
cancelButton={<Button>Cancel</Button>}
primaryButton={<Button appearance='primary'>Save</Button>}
/>
<PeekInPanel title='Ask Trellis'>
<Text.BodyCopy as='p'>
AI-powered insights and suggestions appear in this side panel.
</Text.BodyCopy>
</PeekInPanel>
</PeekIn>
</Box>
)
}

Omit PeekInPanel for a simple header-and-content layout when no supplemental rail is needed.

PeekInFooter pins the overlay's actions below the scrolling content, and takes the same slots as ModalFooter:

  • primaryButton — the main action. Closes the overlay unless closeOnPrimaryAction is false, which you want when the action is async and the overlay should stay open until it settles.
  • cancelButton — always closes the overlay.
  • leftAction — pinned far left, for destructive actions. Never closes the overlay, so you own its confirmation flow.

On desktop the footer spans the main column only, leaving PeekInPanel its full height. On mobile it pins to the bottom of the sheet.

Properties

NameTypeDefaultDescriptionRequired?
aria-label
string
Accessible label for the overlay dialog. Takes precedence over the label derived from `PeekInHeader`'s `title`. Required whenever the header `title` is not a plain string — a `ReactNode` title cannot be read as text, so without this the dialog has no meaningful accessible name.
closeButtonAriaLabel
string
Aria label for the built-in close button
actions
TypePeekInActionProps[]
Additional action buttons shown in the action bar alongside the close button
panelToggle
{ /** Icon name for the panel toggle button */ iconName: TypeIconName; /** Accessible label. Default: "Toggle panel" */ "aria-label"?: string; }
Show a panel toggle button in the action bar. Requires PeekIn.Panel to be present.
snapPoints
TypeDrawerSnapPoint[]
Snap points the mobile bottom-sheet rendering can rest at when swiped. Numbers 0–1 are viewport-height fractions; numbers > 1 are pixels; strings accept `px`/`rem`. Ignored on desktop (full-screen modal).
defaultSnapPoint
TypeDrawerSnapPoint
null
Initial snap point for uncontrolled use. Mobile only.
snapPoint
TypeDrawerSnapPoint
null
Controlled active snap point. Pair with `onSnapPointChange`. Mobile only.
onSnapPointChange
(snapPoint: TypeDrawerSnapPoint | null) => void
Fires when the active snap point changes. Mobile only.
snapToSequentialPoints
boolean
When true, fast swipes can't skip past adjacent snap points. Mobile only.
disableCloseOnClickOutside
boolean
When true, the mobile bottom-sheet rendering does not dismiss when the user taps outside the popup. Useful with snap points so a low-snap peek stays open while the user interacts with nested content.
actionsInHeader
boolean
Opt out of the mobile action rail (default) and render `actions`, the panel toggle, and close button inline in the bottom-sheet header instead. Required for snap-point layouts where the rail would collide with the fully-expanded popup. Ignored on desktop (full-screen modal).
children
React.ReactNode