Skip to content

Banner

An inline notice about the page it sits on: a deploy is blocked, a quota is near.

1.2 kB gzipSource Registry JSON

Banner playground

Storage is at 91%
Writes pause at the limit.

Props

tone

Installation

npx shadcn@latest add https://sproutboat.com/ikada/r/banner.json

The CLI writes components/ikada/banner.tsx and merges the ikada theme into your CSS. It also installs the components it is built from: Status Glyph. Or take it from the package: import { Banner } from "@sproutboat/ikada";

Usage

import { Banner } from "@/components/ikada/banner";

<Banner tone="warning" title="Storage is at 91%">
  Writes pause at the limit.
</Banner>

Examples

Tones

Danger interrupts screen readers as an alert; every other tone is polite.
Deploys use the new runtime
robin picks it up on the next deploy.
Domain verified
robin.sproutboat.app is serving traffic.
Storage is at 91%
Writes pause at the limit.

With an action

One action, usually a Button or a Link.
DNS pending
Add the CNAME record for robin.sproutboat.app to finish.

Dismissible

The close button hides the banner and calls onDismiss. Reload the page to bring it back.
New region
us-east is open for new sprouts.

Props

BannerProps
PropTypeDescription
toneStatusStatus that sets the colour and the glyph. Default info.
titleReactNodeBold first line; the children follow as the body.
actionReactNodeOne action, usually a Button or Link.
dismissiblebooleanShows a close button. The banner hides itself and calls `onDismiss`. Default `false`.
onDismiss(() => void)Shows a close button and is called when it is pressed. Without it the banner stays.
dismissLabelstringAccessible name of the close button. Default "Dismiss".

Also takes every prop of Omit<ComponentProps<"div">, "title">.

Source: src/components/banner.tsx