For the complete documentation index, see llms.txt
Skip to main content

Feedback widget for MkDocs

Add PushFeedback to your MkDocs site.

Prerequisites​

  • A PushFeedback project. Copy its project ID from Projects > your project > Snippet and replace <YOUR_PROJECT_ID> in the examples.
  • A MkDocs project.

Examples use pushfeedback 0.1.87. Choose one installation mode.

These examples use Material for MkDocs. Other themes use different template blocks.

Installation​

Floating button​

Example page with a floating Feedback button on the right edge

Install the theme:

python -m pip install mkdocs-material

Create docs/overrides/main.html:

{% extends "base.html" %}

{% block extrahead %}
{{ super() }}
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/pushfeedback/pushfeedback.css">
<script type="module" src="https://cdn.jsdelivr.net/npm/[email protected]/dist/pushfeedback/pushfeedback.esm.js"></script>
{% endblock %}

{% block content %}
{{ super() }}
<feedback-button project="<YOUR_PROJECT_ID>" button-position="bottom-right" modal-position="sidebar-right" button-style="dark">Feedback</feedback-button>
{% endblock %}

Set the override directory in mkdocs.yml, keeping your existing theme options:

theme:
name: material
custom_dir: docs/overrides

Inline button​

Feedback button placed within page content

Install the theme:

python -m pip install mkdocs-material

Create docs/overrides/main.html:

{% extends "base.html" %}

{% block extrahead %}
{{ super() }}
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/pushfeedback/pushfeedback.css">
<script type="module" src="https://cdn.jsdelivr.net/npm/[email protected]/dist/pushfeedback/pushfeedback.esm.js"></script>
{% endblock %}

{% block content %}
{{ super() }}
<feedback-button project="<YOUR_PROJECT_ID>" button-position="default" modal-position="center" button-style="dark">Feedback</feedback-button>
{% endblock %}

Set the override directory in mkdocs.yml, keeping your existing theme options:

theme:
name: material
custom_dir: docs/overrides

Embedded form​

Feedback form embedded directly in a page

Install the theme:

python -m pip install mkdocs-material

Create docs/overrides/main.html:

{% extends "base.html" %}

{% block extrahead %}
{{ super() }}
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/pushfeedback/pushfeedback.css">
<script type="module" src="https://cdn.jsdelivr.net/npm/[email protected]/dist/pushfeedback/pushfeedback.esm.js"></script>
{% endblock %}

{% block content %}
{{ super() }}
<feedback-modal project="<YOUR_PROJECT_ID>" embedded="true"></feedback-modal>
{% endblock %}

Set the override directory in mkdocs.yml, keeping your existing theme options:

theme:
name: material
custom_dir: docs/overrides

Like and dislike buttons​

Inline Helpful and Not helpful rating buttons

Install the theme:

python -m pip install mkdocs-material

Create docs/overrides/main.html:

{% extends "base.html" %}

{% block extrahead %}
{{ super() }}
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/pushfeedback/pushfeedback.css">
<script type="module" src="https://cdn.jsdelivr.net/npm/[email protected]/dist/pushfeedback/pushfeedback.esm.js"></script>
{% endblock %}

{% block content %}
{{ super() }}
<p>Was this helpful?</p>
<feedback-button project="<YOUR_PROJECT_ID>" rating="1" button-position="default" modal-position="center" button-style="light">Helpful</feedback-button>
<feedback-button project="<YOUR_PROJECT_ID>" rating="0" button-position="default" modal-position="center" button-style="light">Not helpful</feedback-button>
{% endblock %}

Set the override directory in mkdocs.yml, keeping your existing theme options:

theme:
name: material
custom_dir: docs/overrides

Verify the installation​

Run mkdocs build --strict and open your site. Send a test message and confirm it appears in your PushFeedback project. Check allowed URLs if submission fails.

Next steps​

See Layout, Styles, and Text for widget options.