Knit UI
GitHub

Playground

Loading playground…

false
true
false
Playground
<Notification
  title="Upload complete"
  withCloseButton
  withBorder={false}
  loading={false}
  radius="md"
>
  Your file has been uploaded successfully.
</Notification>

Examples

Message Only

Notification without a title — message-only presentation.

Loading example…

Message OnlySourceStorybook

With Title

Bold title alongside the message body; wires aria-labelledby automatically.

Loading example…

With TitleSourceStorybook

With Icon

Icon badge replaces the left accent line; React nodes are accepted.

Loading example…

With IconSourceStorybook

Loading

Loading spinner in the badge slot — useful while an async operation is in progress.

Loading example…

LoadingSourceStorybook

Without Close Button

Close button hidden — for persistent, non-dismissible notifications.

Loading example…

Without Close ButtonSourceStorybook

With Border

withBorder adds a subtle $color7 border around the tile.

Loading example…

With BorderSourceStorybook

Shadows

Each elevation of the shadow prop applied to the notification tile.

Loading example…

ShadowsSourceStorybook

Controlled

Controlled dismiss — onClose hides the notification via local state.

Loading example…

ControlledSourceStorybook

Themed

All theme accents side by side — each one recolors the badge and accent line.

Loading example…

ThemedSourceStorybook

Styles

Per-slot styles targets individual parts — here the icon badge, the title, and the message.

Loading example…

StylesSourceStorybook

Radii

All radius values — from sharp xs corners to very round xl corners.

Loading example…

RadiiSourceStorybook

Props

PropTypeDefaultDescription
childrenReactNodeYour file has been uploaded successfully.Description / message body.
closeButtonProps{ "aria-label"?: string; } | undefinedTyped, cross-platform-safe subset of close-button props.
disabled systemboolean | undefined
iconReactNodeIcon shown in a themed circular badge; replaces the accent line.
loaderPropsPick<LoaderProps, "size" | "type"> | undefinedCross-platform-safe `Loader` passthrough props.
loadingboolean | undefinedfalseReplaces the icon slot with a spinner.
onClose(() => void) | undefinedCalled when the close button is pressed.
radius systemstring | number | undefined
xs · sm · md · lg · xl
mdBorder radius of the notification tile.
shadow system"xs" | "sm" | "md" | "lg" | "xl" | "xxs" | "xxl" | undefined
styles systemSlotStyles<NotificationStyles> | undefinedUniform per-slot style passthrough. See {@link NotificationStyles}.
theme systemThemeName | null | undefined
unset · blue · red · green · yellow · pink · gray
Active theme accent — recolors the badge and accent line.
titleReactNodeUpload completeBold title rendered above the message body.
withCloseButtonboolean | undefinedtrueShow or hide the close button.

Style slots

Every part of Notification can be styled through the styles prop. Explicit props on the component always win over slot styles.

SlotUsage
bodystyles={{ body: { … } }}
closeButtonstyles={{ closeButton: { … } }}
contentstyles={{ content: { … } }}
iconstyles={{ icon: { … } }}
loaderstyles={{ loader: { … } }}
messagestyles={{ message: { … } }}
titlestyles={{ title: { … } }}
Accessibility & DOM props (2)
PropType
keyKey | null | undefined
refRef<TamaguiElement> | undefined

Plus 499 inherited style props from Box — the full Tamagui/React Native style surface, including token shorthands like p, mx, bg and c. See Tokens for the scales they accept, or the full list.