Skyline_banner_v2SourceBanners communicate status and inline messages with optional actions.
A Banner is a container view for composing multiple subviews:
Header should always be used within a Banner, it supports a title, optional icon and arbitrary children (commonly a list of button controls)Section can be used for secondary, more verbose information, usually a paragraph of text. Its intended use is to be shown/hidden based on a "collapse" affordance in the header.Non-banner child components in the Header and Section will need to be explicitly sized to look right. For Button, use the following mapping:
`Xs banner, use an `Xs Button`Sm banner, use a `Sm Button`Md or larger banner, use a `Md ButtonLayout 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
</>
</>
</>
|}val 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.tA 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.