Skip to content

Auto-numbering

Turn on auto-numbering to prefix every quiz with a “Question N” heading, numbered in order down the page. It’s off by default.

Set it once as a site-wide default so every quiz is numbered:

astro.config.mjs
starlightQuiz({
quizDefaults: { autoNumber: true },
});

Or opt a single quiz in (or out) with the autoNumber prop, which overrides the site default:

What does HTTP stand for?

  • HyperText Transfer Protocol
  • High Throughput Transfer Path

The count continues across the page, so a second numbered quiz becomes Question 2:

Which port does HTTPS use by default?

  • 443
  • 80

The number is the quiz’s position among the auto-numbered quizzes on the page, computed in the browser, so it stays correct even with shuffled answers or after an Astro view transition. The heading is a .sl-quiz-number element you can restyle.