(sd-asides)= # Asides Asides are floated call-out boxes that the surrounding text wraps around, ideal for pull-outs, margin notes and short side comments that sit *beside* the flow rather than interrupting it. :::{aside} A pull-out note :align: right :width: 33% Asides float to the side of the main text. On narrow screens they fall back to a full-width block, so nothing is ever squeezed. ::: {{ loremipsum }} `````{dropdown-syntax} ````{tab-set-code} ```{literalinclude} ./snippets/myst/aside-basic.txt :language: markdown ``` ```{literalinclude} ./snippets/rst/aside-basic.txt :language: rst ``` ```` ````` ```{seealso} Asides *complement* [admonitions](https://myst-parser.readthedocs.io/en/latest/syntax/admonitions.html) and [cards](./cards.md): use an **admonition** for a note that interrupts the flow as a full-width block, a **card** for a self-contained boxed unit inside a [grid](./grids.md), and an **aside** when you want the body text to keep flowing *around* a side box. ``` ## Alignment Use the `align` option to float the box `left` or `right` (the default is `right`). :::{aside} Floated left :align: left :width: 33% `:align: left` floats the box to the left, with the text wrapping down its right-hand side. ::: {{ loremipsum }} ## Widths The `width` option accepts `25%`, `33%` (the default) or `50%`, controlling how much horizontal space the box occupies (and therefore how much room is left for the wrapping text). :::{aside} A 50% aside :align: right :width: 50% At `:width: 50%` the box takes up half the content width. ::: {{ loremipsum }} +++ ```{note} Widths are only applied from the `md` breakpoint (768 px) upwards. Below that the aside becomes a full-width block regardless of the `width` option, so it stays readable on small screens. On themes with a right-hand in-page table of contents (such as pydata-sphinx-theme), the main column is already narrower, so a right-floated aside leaves less room for the wrapped text; prefer a smaller `width` or `:align: left` there. ``` ## Stopping the wrap Text keeps wrapping around an aside until it runs out. To force following content to start *below* the box instead, add the `sd-clear-both` utility class to it, for example with an empty `div` directive: ```{aside} Short aside :align: right :width: 25% A short aside. ``` ```{div} sd-clear-both ``` This paragraph is pushed below the aside because the preceding empty `div` has the `sd-clear-both` class. :::{important} Always clear a *trailing* aside A float is not contained by its parent section, so an aside that is the **last element of a section** (with no text left to wrap) can extend past the end of the section and overlap whatever follows — the next heading, or content injected by the theme. When an aside is the final piece of a section, follow it with a cleared block: ``` .. aside:: Wrap-up note :align: right The last content in this section. .. div:: sd-clear-both ``` Themes can address this globally instead, by clearfixing their main content column (for example `.article-container { display: flow-root }`), which contains every float without an explicit clearing element. ::: ## Semantic output In HTML an aside is rendered as a native [`