{% extends "wagtailadmin/generic/base.html" %} {% load wagtailadmin_tags i18n %} {% block extra_css %} {{ block.super }} {{ example_form.media.css }} {% endblock %} {% block bodyclass %}styleguide{% endblock %} {% block header %}
{{ block.super }} {% endblock %} {% block main_content %} {% panel id="typography" heading="Typography" %}

This is an h1

This is an h2

This is an h3

This is an h4

This is an h5

This is a paragraph

  1. These are
  2. items in an
  3. ordered list
This is an example of code {% endpanel %} {% panel id="help" heading="Help text" %}

Help text is not to be confused with the messages that appear in a banner drop down from the top of the screen. Help text are permanent instructions, visible on every page view, that explain or warn about something.

{% help_block status="info" %}

This is help text that might be just for information, explaining what happens next, or drawing the user's attention to something they're about to do

It could be multiple lines

{% endhelp_block %} {% help_block status="warning" %} A warning message might be output in cases where a user's action could have serious consequences. {% endhelp_block %} {% help_block status="critical" %} A critical message would probably be rare, in cases where a particularly brittle or dangerously destructive action could be performed and needs to be warned about. {% endhelp_block %} {% endpanel %} {% panel id="listings" heading="Listings" %}

table listing

Heading 1 Heading 2 Heading 3

TD with title class

Standard TD Standard TD

Unpublished TD with title class

Standard TD Standard TD

TD with title class

Standard TD Standard TD

ul listing

ul listings with multiple columns

Listings used for choosing a list item

Heading 1 Heading 2 Heading 3

TD with title class

Standard TD Standard TD

Disabled TD with title class

Standard TD Standard TD

TD with title class

Standard TD Standard TD
{% endpanel %} {% panel id="pagination" heading="Pagination" %} {% paginate example_page %} {% endpanel %} {% panel id="buttons" heading="Buttons" %}

{% icon name='warning' %}Do not use {% filter force_escape|lower %}{% endfilter %} use {% filter force_escape|lower %}{% endfilter %} instead. This addresses inconsistencies between rendering of buttons across browsers.

Buttons must have interaction possible (i.e be an input or button element) to get a suitable hover cursor.

Basic buttons

button link

Basic buttons (small)

button link

Secondary buttons

button link

Secondary buttons (small)

button link

Disabled buttons

Important: Adding disabled as a class should be avoided on buttons, instead use the disabled attribute. Some examples below use classes to validate existing styling still works.

button link

Disabled buttons (small)

button link

Bi-color icon buttons with text

Note that input elements are not supported by any icon buttons.

{% icon name="plus" wrapped=1 %}button link

Bi-color secondary icon buttons with text

{% icon name="plus" wrapped=1 %}button link

Bi-color icon buttons with text (small)

{% icon name="plus" wrapped=1 %}button link

Bi-color secondary icon buttons with text (small)

{% icon name="plus" wrapped=1 %}button link

Icon buttons without text

{% icon name="cog" %}button link

Icon buttons without text (small)

{% icon name="cog" %}button link

Negative

Should not be used with .button-secondary on the same element.

No link

Negative (small)

No

Buttons with internal loading indicators

Currently only button elements are supported.

{% icon name='warning' %}Note that in some browsers, clicking these buttons minutely affects the appearance of Dropdown buttons, below. This is yet to be resolved.

Buttons where the text is replaced on click

Mixtures

{% icon name="cog" %}A link button {% icon name="check" wrapped=1 %}button link {% endpanel %} {% panel id="dropdowns" heading="Dropdown buttons" %}

{% fragment as button %} dropdown {% endfragment %} {% dropdown_button button=button %} items should not exceed button width {% enddropdown_button %} {% fragment as button %} {% endfragment %} {% dropdown_button button=button toggle_icon="arrow-up" %} first item second item {% enddropdown_button %}

Inline dropdown components.

{% dropdown classname="w-inline-block" toggle_icon="arrow-down" toggle_classname="button button-secondary button-small" toggle_label="More" %} {% icon name="arrow-right-full" %} Move {% icon name="copy" %} Copy {% icon name="bin" %} Delete {% icon name="resubmit" %} Unpublish {% enddropdown %} {% dropdown classname="w-inline-block" toggle_icon="dots-horizontal" toggle_aria_label="Actions" %} {% icon name="arrow-right-full" %} Move {% enddropdown %}
{% endpanel %} {% panel id="dialog" heading="Dialogs" %}
{% dialog_toggle classname='button button-primary' dialog_id='dialog-1' text='Simple dialog' %} {% dialog icon_name="doc-full-inverse" id="dialog-1" title="Simple dialog" subtitle="This is as simple as it gets 😀" %}

This is an example of a simple dialog with an icon_name, title and subtitle passed to the dialog tag

{% enddialog %}
{% dialog_toggle classname='button button-primary' dialog_id='dialog-2' text='Dialog with info' %} {% dialog icon_name="globe" title="Dialog with info" id="dialog-2" subtitle="This is a testing subtitle" message_status="info" message_heading="Here is some info on the thing" message_description="This is a subtext for the message" %}

This dialog message was generated by passing message_status=info as well as message_heading and message_description to the dialog template tag

{% enddialog %}
{% dialog_toggle classname='button button-primary' dialog_id='dialog-3' text='Dialog with success' %} {% dialog icon_name="globe" title="Dialog with success" id="dialog-3" subtitle="This is a testing subtitle" message_status="success" message_heading="Success! You've done the thing" %}

This dialog message was generated by passing message_status=success as well as message_heading to the dialog template tag

{% enddialog %}
{% dialog_toggle classname='button button-primary' dialog_id='dialog-4' text='Dialog with warning' %} {% dialog icon_name="globe" title="Dialog with warning" id="dialog-4" subtitle="This is a testing subtitle" message_status="warning" message_heading="There was an issue with the thing" message_description="This is a subtext for the message" %}

This dialog message was generated by passing message_status=warning as well as message_heading and message_description to the dialog template tag

{% enddialog %}
{% dialog_toggle classname='button button-primary' dialog_id='dialog-5' text='Dialog with error' %} {% dialog icon_name="globe" title="Dialog with critical error" id="dialog-5" subtitle="This is a testing subtitle" message_status="critical" message_heading="There was an issue with the thing" message_description="This is a subtext for the message" %}

This dialog message was generated by passing message_status=critical as well as message_heading and message_description to the dialog template tag

{% enddialog %}
{% dialog_toggle classname='button button-primary' dialog_id='dialog-6' text='Floating dialog' %} {% dialog theme="floating" icon_name="doc-full-inverse" id="dialog-6" title="Floating dialog" subtitle="This is a testing subtitle" %}

This dialog allows other page content to be seen

{% enddialog %}
{% endpanel %} {% panel id="header" heading="Header" %} {% include "wagtailadmin/shared/header.html" with title=page_title %} {% url "wagtailstyleguide" as add_link %} {% include "wagtailadmin/shared/header.html" with title=page_title action_url=add_link icon="image" action_text="button" search_url="wagtailimages:index" %} {% endpanel %} {% panel id="forms" heading="Forms" %}
{% endpanel %} {% panel id="editor" heading="Page editor" %}

Tabs

{% include 'wagtailadmin/shared/tabs/tab_nav_link.html' with tab_id='tab-1' title='Tab 1' %} {% include 'wagtailadmin/shared/tabs/tab_nav_link.html' with tab_id='tab-2' title='Tab 2' %}

Tabs can also indicate errors:

{% include 'wagtailadmin/shared/tabs/tab_nav_link.html' with tab_id='tab-errors-1' title='Tab 1' errors_count='5' %} {% include 'wagtailadmin/shared/tabs/tab_nav_link.html' with tab_id='tab-errors-2' title='Tab 2' errors_count='55' %}
{% endpanel %} {% panel id="progress" heading="Progress indicators" %}
60%

 

50%
{% endpanel %} {% panel id="misc" heading="Misc formatters" %}

Avatar icons

{% avatar %} Avatar normal

{% avatar size="square" %} Avatar square

{% avatar size="small" %} Avatar small

Status tags

{% status "status tag primary" classname="w-status--primary" %}
{% status "status tag secondary" %}
{% status "status tag label" classname="w-status--label" %}
{% status "status tag link" url="https://wagtail.org/" title="wagtail.org" hidden_label="current status" classname="w-status--primary" %}

Loading mask

Add the following div around any items you wish to display with a spinner overlay and fading out

Remove the "loading" class to disable the effect

{% include "wagtailadmin/logo.html"%}

Image transparency

It can be useful to show users the transparent areas of images. Add a transparency checkerboard with the .show-transparency on the img or svg tag thus:

{% include "wagtailadmin/logo.html" with classname="show-transparency" %}
{% endpanel %} {% panel id="icons" heading="Icons" %} {% for folder, icons in all_icons %} {% if folder == "wagtailadmin/icons" %} {# Bespoke copy script with good line breaks to review icon update diffs in git. #} {% endif %}
{% for item in icons %} {% endfor %}
register_icons entries from {{ folder }}
Visual Name Source File path
{% icon name=item.name classname="w-w-8 w-h-8" %} {{ item.name }} {{ item.source }} {{ item.file_path }}
{% endfor %} {% endpanel %} {% endblock %} {% block extra_js %} {{ block.super }} {% include "wagtailadmin/pages/_editor_js.html" %} {{ example_form.media.js }} {% endblock %}