Takumi

Headers & footers

Repeat bands on every page with page counters.

header and footer accept any node input. They repeat on every page. Their measured height is removed from the content window. Bands never overlap with content.

const  = await (, {
  : (
    < ="flex w-full justify-center text-[10px] text-gray-500">
      Page < ="pageNumber" /> of < ="totalPages" />
    </>
  ),
});

Page counters

Elements with pageNumber or totalPages receive counter text. This matches Chromium's print header and footer template contract.

Add a CSS @counter-style name to the class list. It formats the number:

  : (
    < ={{ : 12 }}>
      第 < ="pageNumber trad-chinese-informal" /> 頁,共{" "}
      < ="totalPages trad-chinese-informal" /> 頁
    </>
  ),
Counter styleExample
decimal (default)12
decimal-leading-zero07
lower-roman / upper-romanxii / XII
cjk-decimal一二
trad-chinese-informal / cjk-ideographic十二

Band height is measured once with three-digit counters. Reaching 100 pages does not shift the layout between pages.

Last updated on

On this page