<t-panel>

Floats its contents in a panel that stays in view while the page scrolls. Put a post's controls in one, and they follow the reader through the prose and formulas they drive.

The panel in the bottom-right corner of this page comes from the example below. Drag it by its header, minimize it with −, and scroll: the numbers in it keep updating the text.

Save 300 a month
at 5 a year
for 20 years.

After years you'll have , of which is what you put in and is interest.

Attributes

AttributeDefaultDescription
cornerbottom-rightWhere the panel starts: top-left, top-right, bottom-left or bottom-right. It sits 16px from the edges of the viewport.
labelA caption on the header, which stays visible when the panel is minimized. Also the panel's accessible name. Long labels are cut off with an ellipsis.
widthfits the contentThe width in pixels. Set it to reflow long text.
collapsedStart minimized, showing only the header.

The panel is never dismissed, only minimized, so its contents are always one click away. Minimizing keeps the panel's width, so the header stays a readable bar.

Behavior

Styling

The panel uses --tangle-surface for its background, so it follows the theme. Its pieces are exposed as CSS shadow parts:

SelectorMatches
t-panelThe panel itself: border, background, shadow, z-index.
t-panel::part(header)The draggable header bar.
t-panel::part(label)The caption on the header.
t-panel::part(toggle)The minimize button.
t-panel::part(body)The box around the contents, with its padding.
t-panel[collapsed]A minimized panel.
t-panel {
  border-radius: 0;
  box-shadow: none;
}
t-panel::part(header) {
  background: var(--tangle-accent);
  color: white;
}