Skip to content

Breadcrumbs

breadcrumbs · Elements · interactive

Where you are, and every step back to the top.

Import

cpp
#include "gbui/widgets/breadcrumbs.hpp"

Example

Nothing is downloaded until you press it.

cpp
BreadcrumbsResult breadcrumbs(Ui& ui, const Interaction& input, std::string_view id, const std::vector<Crumb>& trail, const BreadcrumbsOptions& options = {});

A path, with everything but the last step navigable. The last crumb takes current, which is ARIA's aria-current and not selected: a reader is not being told they picked it, they are being told it is where they are.

API

OptionTypeDefaultWhat it does
maxVisiblestd::size_t0How many crumbs may be drawn before the middle collapses. Zero draws all of them. Counted in crumbs, not pixels, because a trail that measured itself would need last frame's width and would therefore be one frame wrong every time the window changed — visibly, since the thing that changes is how many steps you can see.
separatorIconIcon::ChevronRightDrawn between crumbs. A glyph rather than a character so it cannot be mistaken for part of a name.
namestd::string_view"Breadcrumb"What the trail is, for a reader who arrives in the middle of a page. "Breadcrumb" is what every screen reader's user expects to hear.
sizefloat12.5f

Released under the LGPL-3.0-or-later licence.