Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@chakra-ui/breadcrumb

Package Overview
Dependencies
Maintainers
2
Versions
410
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@chakra-ui/breadcrumb

A React component used for navigation, with each item acting as a link

  • 2.2.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
2
Created

What is @chakra-ui/breadcrumb?

@chakra-ui/breadcrumb is a component library for creating breadcrumb navigation in React applications. It provides a set of components that are easy to use and customize, allowing developers to create breadcrumb trails that enhance the navigation experience of their applications.

What are @chakra-ui/breadcrumb's main functionalities?

Basic Breadcrumb

This code sample demonstrates how to create a basic breadcrumb navigation with three items: Home, About, and Contact. The 'isCurrentPage' prop is used to indicate the current page.

```jsx
import { Breadcrumb, BreadcrumbItem, BreadcrumbLink } from '@chakra-ui/breadcrumb';

function BasicBreadcrumb() {
  return (
    <Breadcrumb>
      <BreadcrumbItem>
        <BreadcrumbLink href="#">Home</BreadcrumbLink>
      </BreadcrumbItem>

      <BreadcrumbItem>
        <BreadcrumbLink href="#">About</BreadcrumbLink>
      </BreadcrumbItem>

      <BreadcrumbItem isCurrentPage>
        <BreadcrumbLink href="#">Contact</BreadcrumbLink>
      </BreadcrumbItem>
    </Breadcrumb>
  );
}
```

Custom Separator

This code sample shows how to customize the separator between breadcrumb items using the 'separator' prop. In this example, a ChevronRightIcon is used as the separator.

```jsx
import { Breadcrumb, BreadcrumbItem, BreadcrumbLink } from '@chakra-ui/breadcrumb';
import { ChevronRightIcon } from '@chakra-ui/icons';

function CustomSeparatorBreadcrumb() {
  return (
    <Breadcrumb separator={<ChevronRightIcon color="gray.500" />}> 
      <BreadcrumbItem>
        <BreadcrumbLink href="#">Home</BreadcrumbLink>
      </BreadcrumbItem>

      <BreadcrumbItem>
        <BreadcrumbLink href="#">About</BreadcrumbLink>
      </BreadcrumbItem>

      <BreadcrumbItem isCurrentPage>
        <BreadcrumbLink href="#">Contact</BreadcrumbLink>
      </BreadcrumbItem>
    </Breadcrumb>
  );
}
```

Breadcrumb with Icons

This code sample demonstrates how to include icons in breadcrumb items. Icons are imported from '@chakra-ui/icons' and used within the BreadcrumbLink component.

```jsx
import { Breadcrumb, BreadcrumbItem, BreadcrumbLink } from '@chakra-ui/breadcrumb';
import { HomeIcon, InfoIcon, PhoneIcon } from '@chakra-ui/icons';

function BreadcrumbWithIcons() {
  return (
    <Breadcrumb>
      <BreadcrumbItem>
        <BreadcrumbLink href="#">
          <HomeIcon /> Home
        </BreadcrumbLink>
      </BreadcrumbItem>

      <BreadcrumbItem>
        <BreadcrumbLink href="#">
          <InfoIcon /> About
        </BreadcrumbLink>
      </BreadcrumbItem>

      <BreadcrumbItem isCurrentPage>
        <BreadcrumbLink href="#">
          <PhoneIcon /> Contact
        </BreadcrumbLink>
      </BreadcrumbItem>
    </Breadcrumb>
  );
}
```

Other packages similar to @chakra-ui/breadcrumb

Keywords

FAQs

Package last updated on 18 Jul 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc