Skip to content

Breadcrumbs - Web Component โ€‹

Browser support โ€‹

Detected engine: ย 

  • Chromium

  • Webkit

  • Gecko

Parameters โ€‹

The Web component uses the <z-breadcrumbs> tag:

The parametrization of the component can be done with the following custom HTML params:

NameTypeDescription
crumbsObject[]The links in the breadcrumbs
homebooleanWhether to show the home icon for the first link in the breadcrumbs

crumbs โ€‹

The crumbs parameter is an array of objects with the following properties:

  • text: The text to be displayed for the crumb.
  • to: the URL to navigate to when the crumb is clicked.

home โ€‹

The home parameter is a boolean that determines if the first crumb should be replaced with a home icon.

Playground โ€‹

Customization โ€‹

HTML Examples โ€‹

Imports
html
<link rel="stylesheet" href="/0.4.5/@zurich/web-components/styles.css" />
<script type="module" src="/0.4.5/@zurich/web-components/breadcrumbs.js"></script>
Code
html
<!DOCTYPE html>
<html lang="en">

  <head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>ZDS | Link Web Component example</title>

    <!-- #region imports -->
    <link rel="stylesheet" href="/0.4.5/@zurich/web-components/styles.css" />
    <script type="module" src="/0.4.5/@zurich/web-components/breadcrumbs.js"></script>
    <!-- #endregion imports -->

    <link rel="stylesheet" href="/0.4.5/examples/styles.css" />
    <script type="module" src="/0.4.5/examples/params-script.js"></script>
  </head>

  <body>
    <table>
      <thead>
        <tr>
          <th>-</th>
          <th>home</th>
        </tr>
      </thead>
      <tbody>
        <tr>
          <td>
            <div>
              <z-breadcrumbs
                crumbs='[{ "text": "Link 1", "to": "#" },{ "text": "Link 2", "to": "#" },{ "text": "Link 3", "to": "#" }]'>
              </z-breadcrumbs>
            </div>
          </td>
          <td>
            <div>
              <z-breadcrumbs home
                crumbs='[{ "text": "Link 1", "to": "#" },{ "text": "Link 2", "to": "#" },{ "text": "Link 3", "to": "#" }]'>
              </z-breadcrumbs>
            </div>
          </td>
        </tr>
      </tbody>
    </table>
  </body>

</html>