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
BreadcrumbsOptions
| Option | Type | Default | What it does |
|---|---|---|---|
maxVisible | std::size_t | 0 | How 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. |
separator | Icon | Icon::ChevronRight | Drawn between crumbs. A glyph rather than a character so it cannot be mistaken for part of a name. |
name | std::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. |
size | float | 12.5f |