Need help with sphinx-material?
Click the “chat” button below for chat support from the developer who created it, or find similar developers for support.

About the developer

145 Stars 43 Forks Other 118 Commits 21 Opened issues


A material-based, responsive theme inspired by mkdocs-material

Services available


Need anything else?

Contributors list

Material Sphinx Theme

Continuous Integration

|Travis Build Status|


|PyPI Status|


|MIT License|

A Material Design theme for Sphinx documentation. Based on

Material for MkDocs 
, and `Guzzle Sphinx Theme <>`.

See the theme's

demonstration site 
_ for examples of rendered rst.


Install via pip:

.. code-block:: bash

$ pip install sphinx-material

or if you have the code checked out locally:

.. code-block:: bash

$ python install


Add the following to your

.. code-block:: python

html_theme = 'sphinx_material'

There are a lot more ways to customize this theme, as this more comprehensive example shows:

.. code-block:: python

# Required theme setup
html_theme = 'sphinx_material'

Set link name generated in the top bar.

html_title = 'Project Title'

Material theme options (see theme.conf for more information)

html_theme_options = {

# Set the name of the project to appear in the navigation.
'nav_title': 'Project Name',

# Set you GA account ID to enable tracking
'google_analytics_account': 'UA-XXXXX',

# Specify a base_url used to generate sitemap.xml. If not
# specified, then no sitemap will be built.
'base_url': '',

# Set the color and the accent color
'color_primary': 'blue',
'color_accent': 'light-blue',

# Set the repo location to get a badge with stats
'repo_url': '',
'repo_name': 'Project',

# Visible levels of the global TOC; -1 means unlimited
'globaltoc_depth': 3,
# If False, expand all TOC entries
'globaltoc_collapse': False,
# If True, show hidden TOC entries
'globaltoc_includehidden': False,


Customizing the layout

You can customize the theme by overriding Jinja template blocks. For example, 'layout.html' contains several blocks that can be overridden or extended.

Place a 'layout.html' file in your project's '/_templates' directory.

.. code-block:: bash

mkdir source/_templates
touch source/_templates/layout.html

Then, configure your '':

.. code-block:: python

templates_path = ['_templates']

Finally, edit your override file 'source/_templates/layout.html':


{# Import the theme's layout. #}
{% extends '!layout.html' %}

{%- block extrahead %} {# Add custom things to the head HTML tag #} {# Call the parent block #} {{ super() }} {%- endblock %}

.. |Travis Build Status| image:: :target:

.. |PyPI Status| image:: :target:

.. |MIT License| image:: :target:

We use cookies. If you continue to browse the site, you agree to the use of cookies. For more information on our use of cookies please see our Privacy Policy.