Skip to content

Header

Use Header to render a titled section header with an optional divider and call-to-action. The title and call-to-action render side by side, with the divider spanning the full width beneath them. The component renders nothing when title is empty.

The SDK Header showing a large page title with a full-width divider beneath it.
import { Header } from '/@dropins/tools/components.js';
PropTypeReq?Description
titlestringYesTitle text. The Header renders nothing when this is empty.
size'medium' | 'large'NoChange the header size. Defaults to medium.
dividerbooleanNoShow a divider beneath the title. Defaults to true.
ctaVNodeNoA call-to-action element, such as a Button or link, rendered beside the title.
level1 | 2 | 3 | 4 | 5 | 6NoHeading level for the title. Without it, the title renders as a span.

Header also accepts standard HTML attributes (for example, className), except size.

Render a page header with a title, a heading level, and a divider:

import { Header, provider } from '/@dropins/tools/components.js';
await provider.render(Header, {
title: 'Checkout',
size: 'large',
// Render the title as an <h1>; without level it renders as a plain span.
level: 1,
divider: true,
})(document.querySelector('.checkout-header'));

To render a call-to-action beside the title, pass the cta prop a VNode created with h — for example, a tertiary Button.

  • Divider — the separator the Header renders beneath its title.
  • Button — a common choice for the cta prop.