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

@asphalt-react/breadcrumb

Package Overview
Dependencies
Maintainers
3
Versions
23
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@asphalt-react/breadcrumb

Breadcrumb

  • 1.17.0
  • npm
  • Socket score

Version published
Weekly downloads
7
decreased by-30%
Maintainers
3
Weekly downloads
 
Created
Source

Breadcrumb

A Breadcrumb component gives users navigational awareness inside the app. It can be used declaratively by combining individual components around the data or it can accept the navigation data structure for a non-declerative use.

While non-declerative use is simpler & faster, declerative use offers a greater control.

Along with the main Breadcrumb component, it exposes 2 more components:

  • Separator
  • Crumb

Breadcrumb works with both an anchor tag or a higher order component of any router.

Usage

Breadcrumbs can be used in two ways:

  1. non-decleratively - Using crumbs prop
import Breadcrumb from "@asphalt-react/breadcrumb"

<Breadcrumb crumbs=[{
   { text: "Home", to: "/" },
   { text: "Blog", to: "/blog" },
   { text: "Boom", to: "/blog/boom" },
}] />
  1. decleratively - Using Crumb & Separator components
import Breadcrumb, { Crumb, Separator } from "@asphalt-react/breadcrumb"

<Breadcrumb>
   <Crumb text="Home" to="/" />
   <Separator symbol=">" />
   <Crumb text="Blog" to="/blog" />
   <Separator symbol=">" />
   <Crumb text="Boom" to="/blog/boom" />
</Breadcrumb>

Props

children

React node to render inside the Breadcrumb

typerequireddefault
nodefalseN/A

as

HTML or React element to render as a crumb

typerequireddefault
elementTypefalsenull

tagProps

Props or attributes for the element passed in as prop, these are passed to every crumb. Most of the html global attributes are supported

To have different props or attributes for some crumbs, use linkProps

typerequireddefault
objectfalse{}

crumbs

Array of crumbs object

The crumb object has this shape:

  • text: crumb caption
  • to: URL for respective crumb,
  • linkProps: unique props or attributes for a specific crumb, the tagProps are overridden by linkProps if present
typerequireddefault
arrayOffalse[]

separator

Custom separator text

typerequireddefault
stringfalse"/"

Separator

Component to add the separator symbol between crumbs.

Props

symbol

Custom separator text

typerequireddefault
stringfalse"/"

Crumb

Component to add each individual link in the Breadcrumb.

Props

as

HTML or React element to render as a crumb

typerequireddefault
elementTypefalsenull

tagProps

Props or attributes for element passed in as prop. It supports most of the html global attributes

typerequireddefault
objectfalse{}

text

Caption for the crumb

typerequireddefault
stringfalse""

to

URL for the respective crumb. Avoid using to along with as prop, use tagProps instead

This prop will be removed in the next major version

typerequireddefault
stringfalse""

Renders crumb as a non-link element

typerequireddefault
boolfalsefalse

Keywords

FAQs

Package last updated on 05 Sep 2022

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