inlet

Documentation

API guide forinlet

Installation

npm install inlet-ui

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', 'press', 'keyboard', 'swipe', '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.
backgroundstring'#000'Any CSS background: a colour or a gradient. The camera band stays black, like the hardware.
accentstring'#fff'Peek icons, the loading spinner and the keyboard focus ring.
onDrop / dropLabel(drop: NotchDrop) => void / string— / 'Drop here'Take drops when no activity does.
labelstring'Notch'Screen reader name for the notch's keyboard handle. Defaults to the activity's label.
splitbooleanfalseShow a second activity in a bubble beside the notch. Click it to swap; swipe sideways to cycle.
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.
onDrop(drop: NotchDrop) => void—Accept files, links and text dragged onto the notch. NotchDrop has files, paths (Electron), urls and text.
dropLabelstring'Drop here'What the drop target says while something is over it.
labelstring—A name for screen readers, like "Now Playing".
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, action, reply, level.
action{ label, onClick }5000 msA button in the peek, like Undo. Clicking it runs onClick and closes the peek.
reply{ placeholder?, onSend }8000 msA text field. Enter calls onSend(text) and closes the peek.
levelnumber—A bar from 0 to 1. Peek again with the same id and it moves in place.
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.
notch.show(id) / notch.cycle(dir?)void—Put an activity first, or move to the next (1) or previous (-1).

<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' | 'drop''rest'The current state. 'drop' while something is dragged over it.
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 'inlet-ui/preload'.
hapticsbooleantrueA trackpad tick when the pointer opens the notch, through the native helper. Opening from code stays silent.
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, action (a label), reply ({ placeholder }), level.
expand() / collapse() / toggle() / dismiss()void—Forwarded to the renderer.
on(event, listener)=> unsubscribe—'hover', 'presentation', 'expand', 'collapse', 'drop' (paths, urls, text), 'action' (peek id) and 'reply' (peek id, text).
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.

Drag and drop

Give an activity onDrop and dragging files, links or text over the notch opens it into a drop target that says dropLabel. The highest-priority activity that takes drops gets them. With no activity taking drops, onDrop on the notch itself does.

Styling

background fills the notch below the camera band, which stays black like the hardware. accent colours peek icons, the spinner and the keyboard focus ring.

Accessibility

Peeks are announced as they appear: through a live region on the web, and VoiceOver in SwiftUI. Name activities with label. On the web the notch has a keyboard handle: Tab to it, Enter opens it and moves focus inside, Escape closes it and returns focus. In SwiftUI, call expand(focus: true) from a shortcut to give the notch the keyboard; Escape closes it. Reduced motion swaps the springs for ones that don't bounce.

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.

{
  "spring": {
    "open":  { "response": 0.38, "dampingFraction": 0.8 },
    "close": { "response": 0.3,  "dampingFraction": 1.0 }
  },
  "radius": {
    "rest":     { "top": 6,  "bottom": 10 },
    "toast":    { "top": 8,  "bottom": 18 },
    "expanded": { "top": 12, "bottom": 26 }
  }
}

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.