Banner
A status notice with an icon, a title, an optional description and up to three actions.
Installation
Import from the Reflow workspace package.
Playground
Open demoimport { Banner, BannerTitle, BannerDescription, BannerActions, BannerAction } from '@rtzll/reflow'
import { type Handle } from 'remix/component'
export function Example(handle: Handle) {
return () => (
<>
<Banner status="success" dismissible>
<BannerTitle>Your changes are saved</BannerTitle>
<BannerDescription>Everyone in the workspace can see the latest version.</BannerDescription>
<BannerActions>
<BannerAction variant="primary">Open the docs</BannerAction>
<BannerAction>Add more</BannerAction>
</BannerActions>
</Banner>
</>
)
}Statuses
Five statuses and two contrasts. Low colors the icon and high tints the whole banner.
import { Banner, BannerTitle } from '@rtzll/reflow'
import { type Handle } from 'remix/component'
export function Example(handle: Handle) {
return () => (
<>
<Banner status="info"><BannerTitle>Info</BannerTitle></Banner>
<Banner status="info" contrast="high"><BannerTitle>Info</BannerTitle></Banner>
</>
)
}Actions
Actions follow a one-line title and wrap beneath a description.
import { Banner, BannerTitle, BannerActions, BannerAction } from '@rtzll/reflow'
import { type Handle } from 'remix/component'
export function Example(handle: Handle) {
return () => (
<>
<Banner status="info">
<BannerTitle>Enjoying Reflow?</BannerTitle>
<BannerActions>
<BannerAction variant="primary">Star on GitHub</BannerAction>
<BannerAction>Share</BannerAction>
<BannerAction variant="ghost">Later</BannerAction>
</BannerActions>
</Banner>
</>
)
}Fixed
The notice sits beneath the header while the content scrolls.
import { Banner, BannerTitle, BannerActions, BannerAction } from '@rtzll/reflow'
import { type Handle } from 'remix/component'
export function Example(handle: Handle) {
return () => (
<>
<Banner variant="fixed" status="warning" dismissible>
<BannerTitle>Registry maintenance tonight at 22:00 UTC</BannerTitle>
<BannerActions><BannerAction>Details</BannerAction></BannerActions>
</Banner>
</>
)
}Custom icon
import { Banner, Icon, BannerTitle } from '@rtzll/reflow'
import { type Handle } from 'remix/component'
export function Example(handle: Handle) {
const icon = <svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5"><path d="M4 6h16M4 12h16M4 18h16" /></svg>
return () => (
<>
<Banner icon={<Icon name="bell" />}>
<BannerTitle>3 new components since your last visit</BannerTitle>
</Banner>
</>
)
}API Reference
Public props for the Reflow implementation. Native controls also accept their standard HTML attributes and Remix event mixes.
Banner
| Prop | Type | Default | Description |
|---|---|---|---|
children | RemixNode | — | Child nodes to render inside the element. |
status | "default" | "info" | "success" | "warning" | "error" | default | Semantic status treatment. |
contrast | "low" | "high" | low | Contrast treatment of the status surface. |
variant | "inline" | "fixed" | inline | Visual or layout treatment. |
size | "default" | "compact" | — | Control density or icon-button dimensions. |
icon | RemixNode | — | Icon content. |
dismissible | boolean | — | Shows an action to dismiss the component. |
dismissLabel | string | Dismiss | Accessible name of the dismiss action. |
open | boolean | — | Controlled visibility. |
onDismiss | (() => void) | — | Called after dismissal. |
BannerAction
| Prop | Type | Default | Description |
|---|---|---|---|
active | boolean | — | Applies the active visual state. |
disabled | boolean | — | Prevents interaction and conveys the disabled state. |
leadingIcon | RemixNode | — | Icon shown before the button label. |
loading | boolean | — | Shows progress and prevents repeated activation. |
size | "default" | "compact" | "icon" | "icon-compact" | — | Control density or icon-button dimensions. |
trailingIcon | RemixNode | — | Icon shown after the button label. |
variant | "primary" | "secondary" | "tertiary" | "ghost" | "destructive" | — | Visual or layout treatment. |
children | RemixNode | — | Child nodes to render inside the element. |
type | string | — | The `type` HTML attribute. |
href | string | — | Destination URL when rendered as a link. |