noora
Sign in

Breadcrumbs

Shows where the current page sits in the hierarchy and lets people switch between its siblings.

Separators

slash is the default. arrow suits paths such as files inside a bundle.

<.breadcrumbs style="slash">
  <.breadcrumb id="breadcrumbs-slash-account" label="tuist" href="#separators" />
  <.breadcrumb id="breadcrumbs-slash-project" label="ios-app" href="#separators" />
  <.breadcrumb id="breadcrumbs-slash-page" label="Builds" href="#separators" />
</.breadcrumbs>
<.breadcrumbs style="arrow">
  <.breadcrumb id="breadcrumbs-arrow-bundle" label="Tuist.app" href="#separators" />
  <.breadcrumb id="breadcrumbs-arrow-frameworks" label="Frameworks" href="#separators" />
  <.breadcrumb id="breadcrumbs-arrow-framework" label="TuistKit.framework" href="#separators" />
</.breadcrumbs>

With menus

Items nested in a breadcrumb open in a menu for switching between siblings.

<.breadcrumbs>
  <.breadcrumb id="breadcrumbs-menu-account" label="tuist" href="#with-menus">
    <:icon><.smart_home /></:icon>
  </.breadcrumb>
  <.breadcrumb id="breadcrumbs-menu-project" label="ios-app" href="#with-menus">
    <.breadcrumb_item id="breadcrumbs-menu-ios-app" value="ios-app" label="ios-app" selected />
    <.breadcrumb_item id="breadcrumbs-menu-android-app" value="android-app" label="android-app" />
    <.breadcrumb_item id="breadcrumbs-menu-server" value="server" label="server" />
  </.breadcrumb>
  <.breadcrumb id="breadcrumbs-menu-page" label="Test runs" href="#with-menus" />
</.breadcrumbs>

Avatars and logos

The dashboard header shows an avatar for each account and the build system's logo for each project.

<.breadcrumbs>
  <.breadcrumb
    id="breadcrumbs-rich-account"
    label="tuist"
    href="#avatars-and-logos"
    show_avatar
    avatar_color="blue"
  >
    <.breadcrumb_item
      id="breadcrumbs-rich-account-tuist"
      value="tuist"
      label="tuist"
      show_avatar
      avatar_color="blue"
      selected
    />
    <.breadcrumb_item
      id="breadcrumbs-rich-account-rover"
      value="rover-labs"
      label="rover-labs"
      show_avatar
      avatar_color="orange"
    />
  </.breadcrumb>
  <.breadcrumb
    id="breadcrumbs-rich-project"
    label="ios-app"
    href="#avatars-and-logos"
    image="/images/build-systems/xcode.png"
  >
    <.breadcrumb_item
      id="breadcrumbs-rich-project-ios"
      value="ios-app"
      label="ios-app"
      image="/images/build-systems/xcode.png"
      selected
    />
    <.breadcrumb_item
      id="breadcrumbs-rich-project-android"
      value="android-app"
      label="android-app"
      image="/images/build-systems/gradle.png"
    />
    <.breadcrumb_item
      id="breadcrumbs-rich-project-server"
      value="server"
      label="server"
      image="/images/build-systems/mix.png"
    />
  </.breadcrumb>
  <.breadcrumb id="breadcrumbs-rich-page" label="Module cache" href="#avatars-and-logos" />
</.breadcrumbs>

Guidelines

  • Order the trail from the broadest level to the current page, as the dashboard does: account, then project, then the page.
  • Pass href to each breadcrumb so its label navigates. Nesting breadcrumb_item s adds a menu trigger next to the label for switching to a sibling.
  • Mark the current entry in a menu with selected . It shows a check mark.
  • Each breadcrumb shows one of an image , an avatar, or an icon. Use show_avatar for accounts and image for a project's build system logo. The image takes the place of the avatar and the icon.
  • Put actions such as Create project in the footer slot. It stays below the scrollable list of items.
  • Give every breadcrumb a unique id , and give a breadcrumb_item one when it shows an avatar, since the avatar's id is derived from it.

API reference

<.breadcrumbs>

Attribute Type Default Description
style
string
"slash"
The separator style between breadcrumbs "slash""arrow"

Also accepts global attributes.

Slot Description
inner_block
Breadcrumb items to be rendered

<.breadcrumb>

Attribute Type Default Description
avatar_color
string
"pink"
Color of the avatar when avatar is shown "gray""red""orange""yellow""azure""blue""purple""pink"
href
string
nil
Navigation URL for the breadcrumb label
id Required
string
–
Unique identifier for the breadcrumb component
image
string
nil
URL of a 20px logo shown before the label, such as a project's build system. A breadcrumb shows one of an image, an avatar, or an icon; the image takes their place.
label Required
string
–
Main text displayed in the breadcrumb trigger
on_escape_key_down
string
nil
Event handler for when the escape key is pressed
on_focus_outside
string
nil
Function called when the focus is moved outside the component
on_highlight_change
string
nil
Event handler for when the highlighted option changes
on_interact_outside
string
nil
Function called when an interaction happens outside the component
on_open_change
string
nil
Event handler for when the breadcrumb opens
on_pointer_down_outside
string
nil
Event handler for when the pointer is pressed outside the breadcrumb
on_select
string
nil
Event handler for when an option is selected
show_avatar
boolean
false
Whether to show the avatar

Also accepts global attributes.

Slot Description
:icon
Breadcrumb icon
inner_block
Content to be rendered inside the breadcrumb menu

<.breadcrumb_item>

Attribute Type Default Description
avatar_color
string
"pink"
Color of the avatar when avatar is shown "gray""red""orange""yellow""azure""blue""purple""pink"
href
string
nil
Standard URL for navigation
icon
string
nil
Icon to display. Overrides show_avatar .
id
string
nil
image
string
nil
URL of a 20px logo shown before the label, such as a project's build system. It takes the place of the avatar and the icon.
label Required
string
–
Text displayed as the main content of the item
selected
boolean
false
Whether the item is selected
show_avatar
boolean
false
Whether to show the avatar
value Required
string
–
Value associated with the breadcrumb item