Module Skyline_banner_v2Source

Banners communicate status and inline messages with optional actions.

A Banner is a container view for composing multiple subviews:

Non-banner child components in the Header and Section will need to be explicitly sized to look right. For Button, use the following mapping:

Layout behavior

Banners render as block-level elements and, by default, fill the width of their container. Place them at the top of a page/section.

Example

  {%html|
    <Skyline.Banner.view>
      <Skyline.Banner.Header.text>
        <Skyline.Banner.Header.icon ~icon:%{Lucide.info} />
        A capybara has been sighted!
        <Skyline.Banner.Header.spacer />
        <Skyline.Button.view ~on_click:%{Effect.Ignore} ~variant:%{Ghost}>
          Dismiss
        </>
      </>
    </>
  |}
Sourcemodule Content : sig ... end
Sourceval view : ?test_selector:Bonsai_web.Test_selector.t -> ?attrs:Bonsai_web.Vdom.Attr.t list -> ?size:Skyline_size.t -> ?intent:Skyline_intent.t -> ?loading:[ `Indeterminate ] -> Content.t list -> Bonsai_web.Vdom.Node.t

A banner container.

Parameters:

  • ?test_selector attaches an attribute to the container for testing
  • ?attrs extra attributes applied to the banner container
  • ?size controls padding, text, and icon size. Other Banner.* elements inherit this size. (default `Md)
  • ?intent sets icon, background, and text colors. Other Banner.* elements inherit this. (default `Primary)
  • ?loading renders a loading indicator on the bottom edge if true. (default none)

Returns a single Node.t banner.

Sourcemodule Header : sig ... end
Sourcemodule Section : sig ... end
Sourcemodule For_docs : sig ... end