Components

Banner

A notice across the top of a page, with an action and a dismiss button.

tone
emphasis
scheme

Version 2 is out, with offline sync.

Read the notes

forSlots(BannerSlots)(Recipes.Banner({}))

Usage

The function that drew the preview, over the theme module Create a theme writes. The preview passes it the style picked above instead of its default.

export const BannerStyle = forSlots(BannerSlots)(Recipes.Banner({}))

export const banner = <Message>(style: NamedStyle<typeof BannerSlots>, h: HtmlBuilder<Message>): Html =>
  Banner.view(
    {
      label: 'Announcement',
      message: 'Version 2 is out, with offline sync.',
      action: { label: 'Read the notes', href: '#changelog' },
      style,
    },
    h,
  )

The recipe ↗This code ↗