Skip to main content
InlineBanner composes Banner with a rounded inline layout and a decorative information icon. It shares Banner’s independent status, variant, color, icon and action contracts. Its default appearance is soft and its default status is info.

Usage

The standard layout fills the available width. Plain string children truncate, with keyboard focus, pointer hover or touch revealing the full string in a tooltip. Rich node children render directly, so embedded links and controls retain their own semantics. Compose explicit typography when rich content needs truncation. Use layout="compact" for wrapping content, closer spacing and a maximum content width of 512px. Add fullWidth to remove that cap and fill the available parent width, including padding and borders. It defaults to false and does not change the standard layout, which already fills its parent. It has no bottom margin. Layout is independent of solid or soft appearance. embedded removes the standard layout’s bottom margin.
InlineBanner.Action provides a small outline button that inherits the banner’s displayed color, including explicit palette overrides and solid appearances. It supports Button interactions, links, refs and custom rendering. The action slot also accepts arbitrary controls. The root target is a div. Native props, className, style and ref target that root; Base UI render can compose another element and receives resolved Banner state. action accepts any ReactNode, including multiple controls with their complete Button or link APIs. icon={null} removes the default icon. The caller owns whether the banner is rendered and whether changes should be announced. Supply role="status" and aria-live="polite", or an appropriate live-region wrapper, when needed. Status does not assign live-region semantics. Name action controls and mark decorative custom icons with aria-hidden.

Migration

Replace message with children, LeftIcon={Icon} with icon={<Icon />}, and button configuration with an action node. Use InlineBanner.Action to keep action styling aligned with the banner. Replace variant="compact" with layout="compact"; standard is now the default layout. Use status="error" for error meaning or color="red" for a palette override.

Props

ReactNode
Optional trailing ReactNode. InlineBanner.Action supplies the shared banner action preset and inherits the resolved banner color; arbitrary controls are also accepted.
ReactNode
Caller-provided content. Standard plain strings truncate with a focusable tooltip; rich nodes render directly. Compact content wraps.
string
Class merged onto the root div or composed element.
"blue" | "gray" | "green" | "orange" | "red"
default:"status palette"
Gray, blue, green, orange or red palette override. An omitted color follows status.
boolean
default:"false"
Removes the standard bottom margin. Compact layouts have no bottom margin.
boolean
default:"false"
Fills the available parent width, including padding and borders, and removes the compact layout’s 512px maximum. Defaults to false; standard layout already fills its parent.
ReactNode
default:"decorative information icon"
Leading ReactNode. Defaults to a decorative information icon. Pass null to omit it.
"compact" | "standard"
default:"standard"
Standard full-width layout or compact wrapping layout with a 512px maximum content width. Defaults to standard.
Ref<HTMLDivElement>
Ref to the root div, or to the DOM element supplied through render.
ReactElement<unknown, string | JSXElementConstructor<any>> | ComponentRenderFn<HTMLProps, BannerState>
Base UI root element or render callback, receiving native props/ref and resolved Banner state.
"error" | "info" | "neutral" | "success" | "warning"
default:"info"
Feedback meaning: neutral, info, success, warning or error. Defaults to info. Roles and announcements remain caller-owned.
CSSProperties
Inline styles applied to the root div or composed element.
"soft" | "solid"
default:"soft"
Solid or soft appearance, independently of status and layout. Defaults to soft.

InlineBanner.Action

string | ((state: ButtonState) => string | undefined)
CSS class applied to the element, or a function that returns a class based on the component’s state.
boolean
Adds a shadow and backdrop blur. Neutral outline buttons also use elevated surface colors.
ReactNode
Decorative content displayed after the label.
boolean
default:"false"
Whether the button should be focusable when disabled.
boolean
Expands the button to fill its container width.
string
Destination URL. Renders a native anchor when render is omitted unless nativeButton is explicitly true. Custom renderers retain their own element contract.
boolean
Shows a loading indicator and disables activation.
"center" | "end" | "start"
Where the loading indicator appears. center hides the content while preserving its layout space; start and end keep children and the opposite icon visible and replace the corresponding icon with the spinner.
boolean
default:"true"
Whether the rendered root is a native button. Defaults to true for custom renderers. The built-in href anchor defaults to false; an explicit value takes precedence.
ReactElement<unknown, string | JSXElementConstructor<any>> | ComponentRenderFn<HTMLProps, ButtonState>
Caller-supplied root element or renderer. Native attributes, handlers, event details, and refs reach the rendered root. Use nativeButton={false} and role="link" for a custom navigation anchor. Router integration belongs to the caller.
AriaRole
Role of the root element. Use link for custom navigation renderers.
ShortcutDefinition
Flat key array for simultaneous keys, or nested key arrays for an ordered sequence. Displayed on non-mobile screens.
string
Localized text between sequence steps. Defaults to then.
ReactNode
Decorative content displayed before the label.
CSSProperties | ((state: ButtonState) => CSSProperties | undefined)
Style applied to the element, or a function that returns a style object based on the component’s state.