Skip to content

Banner

FeedbackMIT
View in Storybook

Alert banner with info, success, warning, error, and neutral variants plus dismiss.

bun add @otfdashkit/ui

Preview

Banner
Loading Storybook preview…

Code

import { Banner } from '@otfdashkit/ui'

export function Example() {
  return (
    <div className="flex flex-col gap-3 w-full max-w-lg">
      <Banner variant="info"    title="Info"    description="Something you should know about." dismissible />
      <Banner variant="success" title="Success" description="Everything went smoothly."        dismissible />
      <Banner variant="warning" title="Warning" description="Might need your attention."       dismissible />
      <Banner variant="error"   title="Error"   description="Something went wrong."            dismissible />
      <Banner variant="neutral" title="Neutral" description="A general notice."                dismissible />
    </div>
  )
}

Free with the SDK. This component ships in @otfdashkit/ui under the MIT license.

Kit for this component

Everything Bundle$149 · 6 kits + 20 templates

Show a notice or announcement across the top of a page.

See the kit

Props

Props declared in the Banner source. Inherited HTML attributes are not listed.

PropTypeDefaultDescription
actionBannerAction
childrenReactNode
classNamestring
descriptionstring
dismissibleboolean
iconbooleantrue
onDismiss() => void
titlestring
variant'info' | 'success' | 'warning' | 'error' | 'neutral' | null'info'