Themes

You can always create and use custom themes with the typer:svg-kwargs, typer:html-kwargs, and typer:console-kwargs options but there are also predefined named themes available that can be swapped in using the typer:theme option.

.. typer:: examples.example:app
    :theme: dark

Light (default)

:theme: light
example Usage: example [OPTIONS] {arg}:<one|two> COMMAND [ARGS]... This is the callback function. ╭─ Arguments ───────────────────────────────────────────────────╮ │*arg<one|two>An argument.[required]│ ╰───────────────────────────────────────────────────────────────╯ ╭─ Options ─────────────────────────────────────────────────────╮ │--flag--no-flagFlagged.[default: no-flag]│ │--switch-sSwitch.│ │--helpShow this message and exit.│ ╰───────────────────────────────────────────────────────────────╯ ╭─ Commands ────────────────────────────────────────────────────╮ │fooThis is the foo command.                                │ │barThis is the bar command.                                │ ╰───────────────────────────────────────────────────────────────╯
example Usage: example [OPTIONS] {arg}:<one|two> COMMAND [ARGS]... This is the callback function. ╭─ Arguments ───────────────────────────────────────────────────╮ │*arg<one|two>An argument.[required]│ ╰───────────────────────────────────────────────────────────────╯ ╭─ Options ─────────────────────────────────────────────────────╮ │--flag--no-flagFlagged.[default: no-flag]│ │--switch-sSwitch.│ │--helpShow this message and exit.│ ╰───────────────────────────────────────────────────────────────╯ ╭─ Commands ────────────────────────────────────────────────────╮ │fooThis is the foo command.                                │ │barThis is the bar command.                                │ ╰───────────────────────────────────────────────────────────────╯

Dark

:theme: dark
example Usage: example [OPTIONS] {arg}:<one|two> COMMAND [ARGS]... This is the callback function. ╭─ Arguments ───────────────────────────────────────────────────╮ │*arg<one|two>An argument.[required]│ ╰───────────────────────────────────────────────────────────────╯ ╭─ Options ─────────────────────────────────────────────────────╮ │--flag--no-flagFlagged.[default: no-flag]│ │--switch-sSwitch.│ │--helpShow this message and exit.│ ╰───────────────────────────────────────────────────────────────╯ ╭─ Commands ────────────────────────────────────────────────────╮ │fooThis is the foo command.                                │ │barThis is the bar command.                                │ ╰───────────────────────────────────────────────────────────────╯
example Usage: example [OPTIONS] {arg}:<one|two> COMMAND [ARGS]... This is the callback function. ╭─ Arguments ───────────────────────────────────────────────────╮ │*arg<one|two>An argument.[required]│ ╰───────────────────────────────────────────────────────────────╯ ╭─ Options ─────────────────────────────────────────────────────╮ │--flag--no-flagFlagged.[default: no-flag]│ │--switch-sSwitch.│ │--helpShow this message and exit.│ ╰───────────────────────────────────────────────────────────────╯ ╭─ Commands ────────────────────────────────────────────────────╮ │fooThis is the foo command.                                │ │barThis is the bar command.                                │ ╰───────────────────────────────────────────────────────────────╯

Monokai

:theme: monokai
example Usage: example [OPTIONS] {arg}:<one|two> COMMAND [ARGS]... This is the callback function. ╭─ Arguments ───────────────────────────────────────────────────╮ │*arg<one|two>An argument.[required]│ ╰───────────────────────────────────────────────────────────────╯ ╭─ Options ─────────────────────────────────────────────────────╮ │--flag--no-flagFlagged.[default: no-flag]│ │--switch-sSwitch.│ │--helpShow this message and exit.│ ╰───────────────────────────────────────────────────────────────╯ ╭─ Commands ────────────────────────────────────────────────────╮ │fooThis is the foo command.                                │ │barThis is the bar command.                                │ ╰───────────────────────────────────────────────────────────────╯
example Usage: example [OPTIONS] {arg}:<one|two> COMMAND [ARGS]... This is the callback function. ╭─ Arguments ───────────────────────────────────────────────────╮ │*arg<one|two>An argument.[required]│ ╰───────────────────────────────────────────────────────────────╯ ╭─ Options ─────────────────────────────────────────────────────╮ │--flag--no-flagFlagged.[default: no-flag]│ │--switch-sSwitch.│ │--helpShow this message and exit.│ ╰───────────────────────────────────────────────────────────────╯ ╭─ Commands ────────────────────────────────────────────────────╮ │fooThis is the foo command.                                │ │barThis is the bar command.                                │ ╰───────────────────────────────────────────────────────────────╯

Dimmed Monokai

:theme: dimmed_monokai
example Usage: example [OPTIONS] {arg}:<one|two> COMMAND [ARGS]... This is the callback function. ╭─ Arguments ───────────────────────────────────────────────────╮ │*arg<one|two>An argument.[required]│ ╰───────────────────────────────────────────────────────────────╯ ╭─ Options ─────────────────────────────────────────────────────╮ │--flag--no-flagFlagged.[default: no-flag]│ │--switch-sSwitch.│ │--helpShow this message and exit.│ ╰───────────────────────────────────────────────────────────────╯ ╭─ Commands ────────────────────────────────────────────────────╮ │fooThis is the foo command.                                │ │barThis is the bar command.                                │ ╰───────────────────────────────────────────────────────────────╯
example Usage: example [OPTIONS] {arg}:<one|two> COMMAND [ARGS]... This is the callback function. ╭─ Arguments ───────────────────────────────────────────────────╮ │*arg<one|two>An argument.[required]│ ╰───────────────────────────────────────────────────────────────╯ ╭─ Options ─────────────────────────────────────────────────────╮ │--flag--no-flagFlagged.[default: no-flag]│ │--switch-sSwitch.│ │--helpShow this message and exit.│ ╰───────────────────────────────────────────────────────────────╯ ╭─ Commands ────────────────────────────────────────────────────╮ │fooThis is the foo command.                                │ │barThis is the bar command.                                │ ╰───────────────────────────────────────────────────────────────╯

Night Owlish

:theme: night_owlish
example Usage: example [OPTIONS] {arg}:<one|two> COMMAND [ARGS]... This is the callback function. ╭─ Arguments ───────────────────────────────────────────────────╮ │*arg<one|two>An argument.[required]│ ╰───────────────────────────────────────────────────────────────╯ ╭─ Options ─────────────────────────────────────────────────────╮ │--flag--no-flagFlagged.[default: no-flag]│ │--switch-sSwitch.│ │--helpShow this message and exit.│ ╰───────────────────────────────────────────────────────────────╯ ╭─ Commands ────────────────────────────────────────────────────╮ │fooThis is the foo command.                                │ │barThis is the bar command.                                │ ╰───────────────────────────────────────────────────────────────╯
example Usage: example [OPTIONS] {arg}:<one|two> COMMAND [ARGS]... This is the callback function. ╭─ Arguments ───────────────────────────────────────────────────╮ │*arg<one|two>An argument.[required]│ ╰───────────────────────────────────────────────────────────────╯ ╭─ Options ─────────────────────────────────────────────────────╮ │--flag--no-flagFlagged.[default: no-flag]│ │--switch-sSwitch.│ │--helpShow this message and exit.│ ╰───────────────────────────────────────────────────────────────╯ ╭─ Commands ────────────────────────────────────────────────────╮ │fooThis is the foo command.                                │ │barThis is the bar command.                                │ ╰───────────────────────────────────────────────────────────────╯

Red Sands

:theme: red_sands
example Usage: example [OPTIONS] {arg}:<one|two> COMMAND [ARGS]... This is the callback function. ╭─ Arguments ───────────────────────────────────────────────────╮ │*arg<one|two>An argument.[required]│ ╰───────────────────────────────────────────────────────────────╯ ╭─ Options ─────────────────────────────────────────────────────╮ │--flag--no-flagFlagged.[default: no-flag]│ │--switch-sSwitch.│ │--helpShow this message and exit.│ ╰───────────────────────────────────────────────────────────────╯ ╭─ Commands ────────────────────────────────────────────────────╮ │fooThis is the foo command.                                │ │barThis is the bar command.                                │ ╰───────────────────────────────────────────────────────────────╯
example Usage: example [OPTIONS] {arg}:<one|two> COMMAND [ARGS]... This is the callback function. ╭─ Arguments ───────────────────────────────────────────────────╮ │*arg<one|two>An argument.[required]│ ╰───────────────────────────────────────────────────────────────╯ ╭─ Options ─────────────────────────────────────────────────────╮ │--flag--no-flagFlagged.[default: no-flag]│ │--switch-sSwitch.│ │--helpShow this message and exit.│ ╰───────────────────────────────────────────────────────────────╯ ╭─ Commands ────────────────────────────────────────────────────╮ │fooThis is the foo command.                                │ │barThis is the bar command.                                │ ╰───────────────────────────────────────────────────────────────╯

Blue Waves

:theme: blue_waves
example Usage: example [OPTIONS] {arg}:<one|two> COMMAND [ARGS]... This is the callback function. ╭─ Arguments ───────────────────────────────────────────────────╮ │*arg<one|two>An argument.[required]│ ╰───────────────────────────────────────────────────────────────╯ ╭─ Options ─────────────────────────────────────────────────────╮ │--flag--no-flagFlagged.[default: no-flag]│ │--switch-sSwitch.│ │--helpShow this message and exit.│ ╰───────────────────────────────────────────────────────────────╯ ╭─ Commands ────────────────────────────────────────────────────╮ │fooThis is the foo command.                                │ │barThis is the bar command.                                │ ╰───────────────────────────────────────────────────────────────╯
example Usage: example [OPTIONS] {arg}:<one|two> COMMAND [ARGS]... This is the callback function. ╭─ Arguments ───────────────────────────────────────────────────╮ │*arg<one|two>An argument.[required]│ ╰───────────────────────────────────────────────────────────────╯ ╭─ Options ─────────────────────────────────────────────────────╮ │--flag--no-flagFlagged.[default: no-flag]│ │--switch-sSwitch.│ │--helpShow this message and exit.│ ╰───────────────────────────────────────────────────────────────╯ ╭─ Commands ────────────────────────────────────────────────────╮ │fooThis is the foo command.                                │ │barThis is the bar command.                                │ ╰───────────────────────────────────────────────────────────────╯

Light and Dark Mode

Sphinx themes that support both light and dark modes (e.g. Furo, pydata-sphinx-theme or sphinx-book-theme) switch modes in the browser, so the mode cannot be known when the docs are built. Use the typer:dark-theme option to render the help for both modes, the rendering matching the active mode is shown and the other is hidden:

.. typer:: examples.example:app
    :theme: light
    :dark-theme: dark
example Usage: example [OPTIONS] {arg}:<one|two> COMMAND [ARGS]... This is the callback function. ╭─ Arguments ───────────────────────────────────────────────────╮ │*arg<one|two>An argument.[required]│ ╰───────────────────────────────────────────────────────────────╯ ╭─ Options ─────────────────────────────────────────────────────╮ │--flag--no-flagFlagged.[default: no-flag]│ │--switch-sSwitch.│ │--helpShow this message and exit.│ ╰───────────────────────────────────────────────────────────────╯ ╭─ Commands ────────────────────────────────────────────────────╮ │fooThis is the foo command.                                │ │barThis is the bar command.                                │ ╰───────────────────────────────────────────────────────────────╯
example Usage: example [OPTIONS] {arg}:<one|two> COMMAND [ARGS]... This is the callback function. ╭─ Arguments ───────────────────────────────────────────────────╮ │*arg<one|two>An argument.[required]│ ╰───────────────────────────────────────────────────────────────╯ ╭─ Options ─────────────────────────────────────────────────────╮ │--flag--no-flagFlagged.[default: no-flag]│ │--switch-sSwitch.│ │--helpShow this message and exit.│ ╰───────────────────────────────────────────────────────────────╯ ╭─ Commands ────────────────────────────────────────────────────╮ │fooThis is the foo command.                                │ │barThis is the bar command.                                │ ╰───────────────────────────────────────────────────────────────╯

To do this for every directive set typer_dark_theme in your conf.py. Toggle this page’s theme to see the rendering above switch.