Cove

Documentation

Every option, method and event.

Installation

Works with Electron 28+ and React 18+. A prebuilt universal helper reads the exact notch size and plays haptics, so there is nothing to compile.

Setup

API

<Notch />

NameTypeDefaultDescription
trigger'hover' | 'click' | 'press' | 'manual''hover'How the notch expands. 'press' is a long press.
openDelaynumber120Milliseconds the pointer rests on the notch before it opens.
pressDurationnumber450Milliseconds to hold for trigger='press'.
swipeToDismissbooleantrueFlick up (trackpad or drag) to send it back in.
open / defaultOpenboolean—Controlled or uncontrolled open state.
onOpenChange(open, { reason }) => void—reason is 'hover', 'click', 'outside', 'escape', 'blur' or 'api'.
collapseDelaynumber150Milliseconds after the pointer leaves.
notchSize{ width, height }measuredMeasured from the display in Electron; 185 × 32 in a browser.
menuBar'avoid' | 'overlay''avoid'avoid drops a compact side that would cover a menu bar item. On the web, data-notch-menu-item elements count.
className / style—Applied to the full-window stage.

<NotchActivity />

NameTypeDefaultDescription
leading / trailingReactNode—Beside the camera. About 20px tall.
expandedReactNode—Shown when the notch opens.
prioritynumber0Higher wins. Ties go to the most recently mounted.
width / heightnumberfit contentExpanded size in px. Height includes the camera row.
radiusnumber26Bottom corner radius when expanded.
idstringuseId()Stable identity if you render it from different places.

notch

NameTypeDefaultDescription
notch.peek(content, options?)=> id2600 msA string or any element. Options: type, description, icon, duration, id.
notch.peek.promise(promise, messages)=> Promise—{ loading, success, error }. success and error can be functions.
notch.dismiss(id?)void—Hide the current peek.
notch.expand({ duration? })void—Open; with duration, close again after it unless hovered.
notch.collapse() / toggle()void—Change state from anywhere.

<NotchAvoid /> and useNotchFrame()

NameTypeDefaultDescription
<NotchAvoid gap? boundary?>componentgap 12, windowSlides its children out of the notch; fades them if that would push them past the boundary.
useNotchFrame()=> NotchFrame | null—The notch's target rect in viewport coordinates.

useNotch()

NameTypeDefaultDescription
presentation'rest' | 'compact' | 'peek' | 'expanded''rest'The current state.
activitystring | undefined—The id of the activity being shown.
open / hoveringbooleanfalseWhether the notch is expanded, and whether the pointer is over it.
expand, collapse, toggle, peek, dismiss—The same functions as notch.

createNotch(options) · main process

NameTypeDefaultDescription
entrystring—Dev server URL, or an absolute path to the HTML that renders <Notch>.
display'automatic' | 'primary' | Display'automatic'The built-in notched display first.
canvas{ width, height }760 × 380The transparent window the notch can grow into.
preloadstringbundledYour own preload. It must import 'cove-ui/preload'.
hapticsbooleantrueA trackpad tick on open, through the native helper.
requestMenuBarAccess()=> boolean—Prompts for Accessibility so app menus are avoided too.

NotchHandle

NameTypeDefaultDescription
peek(title, options?)=> id—Options: type, description, icon (emoji or text), duration, id.
expand() / collapse() / toggle() / dismiss()void—Forwarded to the renderer.
on(event, listener)=> unsubscribe—'hover', 'presentation', 'expand' and 'collapse'.
window / screenBrowserWindow / NotchScreenInfo—The panel window and the measured housing.
destroy()void—Close the window and stop tracking the cursor.

From the main process

createNotch() returns a handle, so tray menus, background jobs and system events can peek without going through your renderer.

Design tokens

Shape and motion are defined once in design/tokens.json and generated into Swift and TypeScript. The React renderer runs the same spring as SwiftUI's .spring(response:dampingFraction:), so both platforms move the same way, even mid-animation.

How the Electron version works

The notch is a transparent, non-activating panel above the menu bar, on every Space and over full-screen apps. It ignores the mouse until the pointer is over the notch's current shape, so clicking it never takes focus from the app you were using. The housing is measured with NSScreen.auxiliaryTopLeftArea through a small N-API helper.

For agents

Plain-text setup instructions for coding agents live at /llms.txt.