---
title: choosePage
description: >-
  The theme and renderer for a page. The page's own `theme:` wins, then the
  nearest folder note's (`folderNotes`, nearest first), then whichever renderer
  detects the page from its frontmatter. A page none of that picks is a plain
  note in the primary theme, and gets `undefined`.
updated_at: '2026-10-27T19:43:15+01:00'
created_at: '2026-10-27T19:43:15+01:00'
symbol:
  kind: function
  name: choosePage
  signatures:
    - >-
      choosePage(composition:
      [[reference/api/theme-minimal/runtime/Composition|Composition]], page:
      Page, folderNotes?: readonly Page[]):
      [[reference/api/theme-minimal/runtime/PageChoice|PageChoice]] | undefined
  parameters:
    - name: composition
      type: '[[reference/api/theme-minimal/runtime/Composition|Composition]]'
    - name: page
      type: Page
    - name: folderNotes
      type: 'readonly Page[]'
      optional: true
  returns:
    type: '[[reference/api/theme-minimal/runtime/PageChoice|PageChoice]] | undefined'
  source: >-
    https://github.com/mia-cx/svartz/blob/711f3906a713c8b9a5a572d0f34c85e90c3bc3d1/themes/minimal/src/lib/select.ts#L38
---

# choosePage

Throws a `ThemeSelectionError` naming the page when `theme:` names a theme
the site doesn't compose, when two renderers detect the page, or when a
renderer rejects the page's metadata.
