Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 23 additions & 3 deletions docs/badges_buttons.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,29 @@ See [Bootstrap badges](https://getbootstrap.com/docs/5.0/components/badge/) for

## Buttons

Buttons allow users to navigate to external (`button-link`) / internal (`button-ref`) links with a single tap.
Buttons in Sphinx Design are actually links:

- Links that can be styled to look like
[Bootstrap buttons](https://getbootstrap.com/docs/5.0/components/buttons/)
- Links that are either external (`button-link`) or internal (`button-ref`)

Most of the time, you should create links using the link syntax for the language
you've chosen:

- [Markdown/MyST links and cross-references](https://myst-parser.readthedocs.io/en/latest/syntax/cross-referencing.html#examples)
- [rST links and cross-references](https://www.sphinx-doc.org/en/master/usage/restructuredtext/basics.html#hyperlinks)

Sometimes, though, you may want to call attention to a particular link or set of
links, or set them apart visually from other links on the site.

:::{admonition} Note on accessibility

Despite the name, `button-link` and `button-ref` do **not** convert to
`<button>` tags in HTML. They are output as `<a>` tags and use CSS to achieve
the button look. This has important accessibility implications. For example,
assistive tech will include Sphinx Design "buttons" when asked to present a list
of all the links on the page.
:::

```{button-link} https://example.com
```
Expand Down Expand Up @@ -176,8 +198,6 @@ Use the `click-parent` option to make the button's parent container also clickab

:::

See the [Material Design](https://material.io/components/buttons) and [Bootstrap](https://getbootstrap.com/docs/5.0/components/buttons/) descriptions for further details.

### `button-link` and `button-ref` options

ref-type (`button-ref` only)
Expand Down
Loading