Kinetik UI

Notice Bar

.md

A slim announcement bar whose messages take turns rolling in; closing it folds the bar shut.

v1.0.0Live on webreact-native-reanimatedreact-native-worklets
Component preview

Installation

Kinetik CLI
npx kinetik-ui add notice-bar

The CLI copies the source and installs native dependencies with npx expo install, so versions match your Expo SDK. With shadcn: npx shadcn@latest add https://kinetik-ui.dev/r/notice-bar.json

Install manually

  1. Install dependencies
    npx expo install react-native-reanimated react-native-worklets
  2. Copy the source files
    • components/kinetik/notice-bar.tsx
    View source files

Usage

import { NoticeBar } from '@/components/kinetik/notice-bar';

<NoticeBar
  messages={[
    { text: 'Spring prints are here', action: { label: 'Browse', onPress: openCollection } },
    { text: 'Free shipping on orders over $50' },
  ]}
  onDismiss={() => setShowBar(false)}
/>;

With more than one message they take turns every interval ms. Pass onDismiss to show a close button; it is called once the bar has folded away, so remove it from the tree there and remember the choice.

When to use

  • Short, timely news at the top of a screen: offers, new features, service notes.
  • Messages people may ignore without missing anything they need.

When not to use

  • Errors or anything that needs action. Use an inline alert or a toast.
  • More than three messages. Nobody waits for the fourth.

Notes

  • Holding the bar pauses it, and it stops turning while a screen reader is on, since moving text is hard to follow.
  • Text is cut to one line, so keep each message short; the action sits right after it.
  • With reduced motion messages change in place and the bar closes at once.

Props

NoticeBarProps

PropTypeDefaultDescription
messagesrequiredreadonly Notice[]—One or more messages; several take turns.
intervalnumber4500Time each message stays, in ms. Defaults to 4500.
tone'azure' | 'neutral''azure'`azure` for news and offers, `neutral` for quieter notes. Defaults to `azure`.
leadingReactNode—Shown before the text, e.g. a small icon.
onDismiss() => void—Shows a close button. Called once the bar has folded away.
testIDstring—
styleStyleProp<ViewStyle>—

Performance and accessibility

Performance

Budget
Plain views. A timer turns the message every few seconds and one shared value rolls it; between turns nothing runs.
Measured

Pixel 9 emulator, API 35, release build · interaction median 0.85× the system Settings app on the same emulator (indicative only) · keeps drawing at rest · 148 MB app memory. The frames at rest are the demo messages taking turns every 4 s.

Real-device measurement pending.

Accessibility

Reduced motion
Messages change in place and the bar disappears at once when closed.
Screen readers
Messages stop turning while a screen reader is on. Actions are links and the close button is named Dismiss.
Touch target
The bar and the close button are 44 pt tall; links get 8 pt of slop above and below.

Source files

components/kinetik/notice-bar.tsx is in the Code tab of the preview above.