@zendeskgarden/container-breadcrumb
TypeScript icon, indicating that this package has built-in type declarations

1.0.8 • Public • Published

@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.

Dependencies (1)

Dev Dependencies (0)

    Package Sidebar

    Install

    npm i @zendeskgarden/container-breadcrumb

    Weekly Downloads

    6,841

    Version

    1.0.8

    License

    Apache-2.0

    Unpacked Size

    16.9 kB

    Total Files

    9

    Last publish

    Collaborators

    • zendesk-garden