Read the Docs theme for Sphinx documentation with responsive design and interactive navigation
Comprehensive configuration system with 19 options controlling navigation behavior, styling, and responsive design features.
Set options in your Sphinx conf.py:
html_theme_options = {
'collapse_navigation': True,
'sticky_navigation': True,
'navigation_depth': 4,
'includehidden': True,
'titles_only': False,
'logo_only': False,
'prev_next_buttons_location': 'bottom',
'style_external_links': False,
'style_nav_header_background': '',
'vcs_pageview_mode': '',
'flyout_display': 'hidden',
'version_selector': True,
'language_selector': True
}'collapse_navigation': bool # Default: TrueControls whether navigation menu items are collapsed by default. When True, only the current page's section is expanded, keeping the sidebar compact. When False, all navigation sections remain expanded.
'sticky_navigation': bool # Default: TrueEnables sticky navigation behavior where the sidebar follows the user's scroll position. When True, the navigation stays visible as users scroll through long pages.
'navigation_depth': int # Default: 4Sets the maximum depth of navigation tree to display in the sidebar. Deeper nested pages will not appear in the navigation menu.
'includehidden': bool # Default: TrueWhether to include hidden toctree entries in the navigation. When True, pages marked as hidden in the toctree directive will still appear in the sidebar.
'titles_only': bool # Default: FalseWhen True, displays only page titles in navigation without showing subsection headers within each page.
'logo_only': bool # Default: FalseWhen True, displays only the logo in the navigation header without the project title text.
'style_external_links': bool # Default: FalseWhen True, applies special styling to external links to distinguish them from internal links.
'style_nav_header_background': str # Default: ''Custom CSS styling for the navigation header background. Accepts any valid CSS background property value.
'prev_next_buttons_location': str # Default: 'bottom'Controls placement of previous/next page navigation buttons. Valid values:
'bottom': At the bottom of the page content'top': At the top of the page content'both': At both top and bottom'none': Hide prev/next buttons'version_selector': bool # Default: TrueShows version selector dropdown in the navigation when multiple versions are available (typically in Read the Docs environment).
'language_selector': bool # Default: TrueShows language selector dropdown in the navigation when multiple languages are available (typically in Read the Docs environment).
'flyout_display': str # Default: 'hidden'Controls the display behavior of the flyout menu for versions and languages. Valid values:
'hidden': Hide flyout menu by default'attached': Show flyout menu attached to navigation'floating': Show flyout menu as floating element'vcs_pageview_mode': str # Default: ''Sets the version control page view mode for Read the Docs integration. This affects how edit/view source links are generated.
The following options are deprecated and will generate warnings:
'canonical_url': str # DEPRECATEDReplacement: Use Sphinx's built-in html_baseurl configuration option instead.
Warning: "The canonical_url option is deprecated, use the html_baseurl option from Sphinx instead."
'analytics_id': str # DEPRECATEDReplacement: Use the sphinxcontrib-googleanalytics extension instead.
Warning: "The analytics_id option is deprecated, use the sphinxcontrib-googleanalytics extension instead."
'analytics_anonymize_ip': bool # DEPRECATEDReplacement: Use the sphinxcontrib-googleanalytics extension instead.
Warning: "The analytics_anonymize_ip option is deprecated, use the sphinxcontrib-googleanalytics extension instead."
The theme inherits from Sphinx's basic theme with the following configuration:
[theme]
inherit = basic
stylesheet = css/theme.css
pygments_style = default
[options]
# All 19 configuration options with their defaults
canonical_url =
analytics_id =
analytics_anonymize_ip = False
collapse_navigation = True
sticky_navigation = True
navigation_depth = 4
includehidden = True
titles_only =
logo_only =
prev_next_buttons_location = bottom
style_external_links = False
style_nav_header_background =
vcs_pageview_mode =
flyout_display = hidden
version_selector = True
language_selector = True# Basic responsive theme with defaults
html_theme = 'sphinx_rtd_theme'html_theme_options = {
'collapse_navigation': False, # Keep all sections expanded
'navigation_depth': 2, # Show only 2 levels deep
'titles_only': True, # Show only page titles
'prev_next_buttons_location': 'both' # Buttons top and bottom
}html_theme_options = {
'logo_only': True, # Show only logo, not project title
'style_nav_header_background': '#2c3e50', # Custom header color
'style_external_links': True # Highlight external links
}html_theme_options = {
'version_selector': True, # Show version dropdown
'language_selector': True, # Show language dropdown
'flyout_display': 'attached', # Attach flyout to nav
'vcs_pageview_mode': 'edit' # Show edit links
}html_theme_options = {
'sticky_navigation': True, # Keep nav visible on mobile
'collapse_navigation': True, # Compact navigation
'navigation_depth': 3, # Limit depth for mobile
'titles_only': False # Show subsections for context
}Install with Tessl CLI
npx tessl i tessl/pypi-sphinx-rtd-theme