JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 35470
  • Score
    100M100P100Q166423F
  • License Apache-2.0

Containers relating to breadcrumb in the Garden Design System

Package Exports

  • @zendeskgarden/container-breadcrumb
  • @zendeskgarden/container-breadcrumb/dist/index.cjs.js
  • @zendeskgarden/container-breadcrumb/dist/index.esm.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@zendeskgarden/container-breadcrumb) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

@zendeskgarden/container-breadcrumb npm version

This package includes containers relating to breadcrumbs in the Garden Design System.

Installation

npm install @zendeskgarden/container-breadcrumb

Usage

This container implements the breadcrumb design pattern and can be used to build a breadcrumb component. Check out storybook for live examples.

As a Render Prop Component

import { BreadcrumbContainer } from '@zendeskgarden/container-breadcrumb';

<BreadcrumbContainer>
  {(getContainerProps, getCurrentPageProps) => (
    <div {...getContainerProps()}>
      <a href="#">Home</a>
      <a {...getCurrentPageProps({ href: '#' })}>Items</a>
    </div>
  )}
</BreadcrumbContainer>;

As a hook

import { useBreadcrumb } from '@zendeskgarden/container-breadcrumb';

const Breadcrumb = () => {
  const { getContainerProps, getCurrentPageProps } = useBreadcrumb();

  return (
    <div {...getContainerProps()}>
      <a href="#">Home</a>
      <a {...getCurrentPageProps({ href: '#' })}>Items</a>
    </div>
  );
};

Info

See react-breadcrumbs component.