qat

Banner and callout

Banner, Callout. They are copied into your app’s ui/ by qatjs add banner: the code is yours to edit.

Example

Azərpoçt is not collecting today. Orders placed now ship tomorrow.
Derived values are lazy. Nothing is computed until something reads it.
Example.qx23 linesOpen in the playground
import { Banner, Callout } from './ui/banner/banner.qx'
import Button from './ui/button/button.qx'

export default function Example() {
  return (
    <Banner
     
      tone="warning"
      dismissible
      action={
        <Button size="sm" variant="tertiary">
          Change courier
        </Button>
      }
    >
      Azərpoçt is not collecting today. Orders placed now ship tomorrow.
    </Banner>
    <Banner tone="danger">
      Payments are down since 09:12. Orders are saved and will charge when the provider recovers.
    </Banner>
    <Callout>Derived values are lazy. Nothing is computed until something reads it.</Callout>
  )
}

Add it

shell1 line
npx qatjs add banner

As a custom element: <ui-banner>.

Banner: props
PropTypeAttribute
tone'info' | 'success' | 'warning' | 'danger'yes
actionQatNodeproperty only
dismissiblebooleanyes
dismissLabelstringyes
Banner: events
EventDetail
on:dismissCustomEvent<undefined>

Callout

As a custom element: <ui-callout>.

Callout: props
PropTypeAttribute
tone'info' | 'success' | 'warning' | 'danger'yes