component

Banner

props · 29 shown · 29 total

Appearance

  • "transparent" "surface.peak" "surface.hill" "surface.base" "surface.valley" "surface.ground"
    default "transparent"

    Panel surface fill. Only meaningful when `tone="neutral"`.

  • "none" "default" "bold" "muted" "accent"
    default "none"

    Panel border ring strength. Only meaningful when `tone="neutral"`.

  • "primary" "secondary" "tertiary"

    Panel emphasis variant. Under `"primary"`, panel-aware text colors flip to their contrast variant.

  • "eyebrow" "control.lg" "control.md" "control.sm" "control.xl" "control.xs" "caption" "body.lg" "body.md" "body.sm" "code" "heading.2xl" "heading.2xs" "heading.3xs" "heading.lg" "heading.md" "heading.sm" "heading.xl" "heading.xs" "kbd" "label.lg" "label.md" "label.sm" "lead" "numeric.lg" "numeric.md" "numeric.sm" "quote"

    Text style token applied to the eyebrow slot (e.g. `"eyebrow"`, `"label.sm"`). Overrides the `size`-derived typography for the eyebrow; `passThrough.eyebrow.style` still layers on top.

  • "eyebrow" "control.lg" "control.md" "control.sm" "control.xl" "control.xs" "caption" "body.lg" "body.md" "body.sm" "code" "heading.2xl" "heading.2xs" "heading.3xs" "heading.lg" "heading.md" "heading.sm" "heading.xl" "heading.xs" "kbd" "label.lg" "label.md" "label.sm" "lead" "numeric.lg" "numeric.md" "numeric.sm" "quote"

    Text style token applied to the heading slot (e.g. `"numeric.md"`, `"heading.lg"`). Overrides the `size`-derived typography for the heading (including `headingWeight`); only `passThrough.heading.style` layers on top.

  • "normal" "semibold"
    default semibold

    Heading font weight. `"normal"` renders the heading as plain body text.

  • "lg" "md" "sm" "xs" "none" "xl" "2xl" "2xs" "3xl" "4xl" "5xl" "6xl" "inherit" "inner" "full"
    default "none"

    Panel radius token.

  • "lg" "md" "sm" "xs" "none" "xl" "2xl" "2xs" "3xl" "4xl" "5xl" "6xl" "inherit" "inner" "full"

    Panel radius token applied to the bottom corners only.

  • "lg" "md" "sm" "xs" "none" "xl" "2xl" "2xs" "3xl" "4xl" "5xl" "6xl" "inherit" "inner" "full"

    Panel radius token applied to the left corners only.

  • "lg" "md" "sm" "xs" "none" "xl" "2xl" "2xs" "3xl" "4xl" "5xl" "6xl" "inherit" "inner" "full"

    Panel radius token applied to the right corners only.

  • "lg" "md" "sm" "xs" "none" "xl" "2xl" "2xs" "3xl" "4xl" "5xl" "6xl" "inherit" "inner" "full"

    Panel radius token applied to the top corners only.

  • "lg" "md" "sm" "xs" "none" "xl"

    Panel drop-shadow token.

  • "lg" "md" "sm" "xs"
    default "md"

    Controls the heading font size. Padding and radius come from Panel and can be set independently.

  • "eyebrow" "control.lg" "control.md" "control.sm" "control.xl" "control.xs" "caption" "body.lg" "body.md" "body.sm" "code" "heading.2xl" "heading.2xs" "heading.3xs" "heading.lg" "heading.md" "heading.sm" "heading.xl" "heading.xs" "kbd" "label.lg" "label.md" "label.sm" "lead" "numeric.lg" "numeric.md" "numeric.sm" "quote"

    Text style token applied to the subheading slot (e.g. `"body.sm"`, `"caption"`). Overrides the `size`-derived typography for the subheading; `passThrough.subheading.style` still layers on top.

  • BannerTone
    default "neutral"

    Semantic surface color inherited from Panel. When set to anything other than `neutral`, banner owns its background via the tone palette.

  • boolean
    default false

    Frosted-glass backdrop blur. Only meaningful when `tone="neutral"`.

Layout

  • "lg" "md" "sm" "xs" "xl"

    Render the banner as a sized control row — a navigation item, a list or menu row — on the Control Var Contract, like a Button or an Input of the same size: `data-control-size` is baked on the root, the row takes the control height and padding, and the `leading` / `trailing` Affixes flip that padding per side. The text rows stop setting their own type: the heading inherits the row's font and colour, and while it is the only text row it lays out as a direct child of the row. Leave it unset for a block banner (a card or section header).

  • BannerLayout

    All layout configuration, keyed per slot (mirrors `passThrough`). Each slot owns its own object: - `root: { align }` — cross-axis alignment of the root flex (leading ↔ text block ↔ trailing). Default `"stretch"`. - `content: { align }` — horizontal alignment of the whole text block. Default `"start"`. - `leading: { align, span }` — leading element's cross-axis self-alignment (overrides `root.align`) and flank `span` (`"all"` | `"above"` | `"below"`, default `"all"`). - `trailing: { align, justify }` — trailing element's cross-axis self-alignment (overrides `root.align`) and horizontal `justify` of its own content (`"end"` flushes constrained content to the right edge; default `"center"`). - `eyebrow` / `heading` / `subheading: { align, trailing, lines, gap }` — per-row cross-axis `align` (default `"firstLine"`: addons sit on the row's first line), trailing-element placement (`"apart"` at the right edge or `"together"` next to the text, default `"apart"`), `lines` (the row's leading in whole raster lines) and `gap` (whole raster lines of space above the row; ignored on the eyebrow). `lines` and `gap` are the rhythm knobs: both are inert outside a `[data-rhythm]` scope, so a banner that never opts in renders identically whatever they are set to.

  • "lg" "md" "sm" "xs" "none" "xl" "2xl" "10xl" "11xl" "2xs" "3xl" "3xs" "4xl" "4xs" "5xl" "6xl" "7xl" "8xl" "9xl"
    default "none"

    Panel padding token. Defaults to none so banner reads flat inside cards/dialogs.

  • boolean
    default false

    Opt the banner into the baseline rhythm: `data-rhythm` is baked on the root and the eyebrow / heading / subheading quantise their leading to the line. An ancestor scope (a `<Grid rhythm>`, a `<Card rhythm>`, any `[data-rhythm]`) quantises the text without this prop — which is how a banner inside a card header stays on the baseline without taking a second padded box. The padded box is surface-aware. A banner with a visible surface (a non-transparent `background`, a `border` or a `shadow`) is forwarded to Panel, which pads it one whole line per edge. The default transparent, borderless banner takes the scope only: its padding would be invisible space pushing the text off the column edge the grid gave it. Inside any rhythm scope, with or without this prop, every row defaults to one line of leading at `xs`–`md` (the `lg` heading keeps the round-up), so the kicker, title and subtitle read as one block. `layout.*.lines` still wins, and a row whose `*TextStyle` is overridden keeps the round-up. With this prop, the leading element also flanks the heading + subheading pair (`layout.leading.span` defaults to `"below"`, eyebrow full width above).

Accessibility

  • 1 2 3 4 5 6 "none"
    default 3 (`"none"` in row mode, `control`)

    Document outline level of the heading row — picks the rendered tag (`1` → `<h1>` … `6` → `<h6>`). Purely semantic: typography still comes from `size` / `headingWeight` / `headingTextStyle`, so raising a banner to the page's `<h1>` never changes how it looks. Set it whenever the banner is a real section or page heading rather than a card title. `"none"` renders the heading row as a non-heading `<span>` with the same typography — for a banner that titles a row rather than a section (a list row, a menu entry), so it adds no entry to the document outline.

Slots

  • children slot svelte
    Snippet

    The banner body content, rendered in the content column.

  • eyebrow slot svelte
    string Snippet TitleWithLeadingTrailing

    The eyebrow kicker line above the heading. Accepts a string/snippet or a `{ leading, content, trailing }` object.

  • heading slot svelte
    string Snippet TitleWithLeadingTrailing

    The heading line. Accepts a string/snippet or a `{ leading, content, trailing }` object.

  • leading slot svelte
    string Snippet

    The leading element flanking the text block (e.g. an icon or Stamp).

  • subheading slot svelte
    string Snippet TitleWithLeadingTrailing

    The subheading line below the heading. Accepts a string/snippet or a `{ leading, content, trailing }` object.

  • trailing slot svelte
    string Snippet

    The trailing element of the banner.

Advanced

  • element binding svelte
    HTMLDivElement null

    Bindable reference to the banner's root element.

  • BannerPassThrough<RootElementAttributes, SlotElementAttributes>

    Per-slot style/attribute override bag. Each slot accepts a `style` (Panda style object) merged into its base styles and a `props` bag of extra HTML attributes.

Plus all standard <div> HTML attributes.

Type

  • Components
  • Blocks