Body copy: the message. Carries the alert's accessible text.
intent
NockerlBannerIntent
'info'
Semantic intent: drives the status color, the default icon, and role.
title
string
n/a
Optional bold heading above the message (a single short line).
icon
boolean
true
Show the leading status disc. Defaults to on; turn off for a bare banner.
actionLabel
string
n/a
Optional inline action label (a quiet text button, right-aligned).
onAction
() => void
n/a
Action handler. Ignored when no actionLabel is given.
dismissible
boolean
false
Show a dismiss (X), a separate focusable control.
onDismiss
() => void
n/a
Dismiss handler (the X).
NockerlBanner is the proposed Compose component: a NockerlSurface (panel radius +
the shared lit-from-above material) washed with the intent’s status color and bordered with
its hairline, exactly the shipped errorContainer / ErrorSegment treatment generalised.
Parameter
Type
Default
Description
message *
String
n/a
Body copy, rendered with bodyMedium on the card foreground.
intent
NockerlBannerIntent
INFO
Status intent: INFO · SUCCESS · WARNING · DANGER · NEUTRAL. INFO is the only cyan; NEUTRAL uses onCard.
modifier
Modifier
Modifier
Outer modifier. Pass Modifier.fillMaxWidth() for a full-bleed banner.
title
String?
null
Optional heading (one line) above the message, in the status color.
showIcon
Boolean
true
Show the leading status icon (top-aligned). Color is paired with the icon + text, never alone.
action
(@Composable -> Unit)?
null
Optional trailing action slot, typically a GHOSTNockerlButton, pinned right.
onDismiss
(() -> Unit)?
null
When non-null, renders a dismiss NockerlIconButton (PLAIN) as a separate target. null → not dismissible.
NockerlBanner is the proposed SwiftUI view: a rounded-rect surface tinted by the intent’s
NockerlTheme status token (error / warning / success / accent for info), echoing the
shipped RecordingHUD error row (status glyph + message) as a reusable inline alert.
Optional heading above the message, in the status color. Defaults to nil.
showIcon:
Bool
n/a
Leading SF Symbol in the status color (e.g. exclamationmark.triangle.fill), top-aligned. Defaults to true.
action:
BannerAction?
n/a
Optional (label, handler) for a quiet trailing .nockerlGhost button, right-aligned. Defaults to nil.
onDismiss:
(() -> Void)?
n/a
When non-nil, shows a trailing dismiss NockerlIconButton (xmark) as a separate control. nil → not dismissible.
Cross-platform drift (tracked for reconciliation)
The banner now ships on web as NockerlBanner in @dizyx/nockerl-react, and on both
natives as NockerlBanner. The web component is the one documented above; the native surfaces
are on their own migration track, so treat the list below as the reconciliation list rather
than as a description of one shared API:
Source patterns differ: Android has the inline ErrorSegment + the errorContainer
tokens (tonal status fill + status hairline + status icon/text); Voice has only the
RecordingHUD error row (a warning glyph + message). Neither is a reusable component, so this
page proposes the shared one.
info intent color: Android/web map info to the brand cyan (status.info); Voice has
no info status token and would use NockerlTheme.accent. One mapping should be canonized.
Neutral intent: Voice has no neutral-status surface; it would fall back to a plain
chromeSurface card with on-surface text. Android/web wash with onCard.