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

@purpurds/breadcrumbs

Package Overview
Dependencies
Maintainers
0
Versions
70
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@purpurds/breadcrumbs

import { Meta, Stories, ArgTypes, Primary, Subtitle } from "@storybook/blocks";

  • 5.8.2
  • npm
  • Socket score

Version published
Weekly downloads
506
decreased by-39.04%
Maintainers
0
Weekly downloads
 
Created
Source

import { Meta, Stories, ArgTypes, Primary, Subtitle } from "@storybook/blocks";

import * as BreadcrumbsStories from "./src/breadcrumbs.stories"; import packageInfo from "./package.json";

Breadcrumbs

Version {packageInfo.version}

When a website has a lot of pages, breadcrumbs can help a user find their current location within the overal hierarchy. This page shows how you can make breadcrumbs accessible to all users.

Use them when you have several levels of navigation and want to make the parent pages available as navigation.

Accessibility

The Purpur breadcrumbs are accessible by default according to best practices. The last BreadcrumbsItem is the one belonging to the page the user is currently on.

Meta Data & SEO

Another benefit of helping the user find their way, is that we also help the search engines increasing understanding of our site.

By default, the breadcrumbs will render a JSON+LD script tag with structured meta data extracted from the breadcrumb items.

If you need a custom link, perhaps to use a router, like the next/link component, you can simply pass your custom link component and skip the href property on Breadcrumbs.Item, only passing it directly to <Link />.

Showcase

Properties

Installation

Via NPM

Add the dependency to your consumer app like "@purpurds/purpur": "^x.y.z"

In MyApp.tsx

import "@purpurds/purpur/styles";

In MyComponent.tsx

import { Breadcrumbs } from "@purpurds/purpur";

export const MyComponent = () => {
  return (
    <Breadcrumbs>
      <Breadcrumbs.Item href="/ships" onClick={() => console.log("clicking on ships")}>
        Ships
      </Breadcrumbs.Item>
      <Breadcrumbs.Item href="/ships/twin-seaters/">Twin Seaters</Breadcrumbs.Item>
      <Breadcrumbs.Item href="/ships/twin-seaters/naboo-n1">N1 Starfighter</Breadcrumbs.Item>
    </Breadcrumbs>
  );
};

With a custom link component such as next/link:

import { Breadcrumbs } from "@purpurds/breadcrumbs";
import Link from "next/link";

export const MyComponent = () => {
  return (
    <Breadcrumbs>
      <Breadcrumbs.Item>
        <Link href="/ships">Ships</Link>
      </Breadcrumbs.Item>
      <Breadcrumbs.Item>
        <Link href="/ships/twin-seaters">Twin Seaters</Link>
      </Breadcrumbs.Item>
      <Breadcrumbs.Item>
        <Link href="/ships/twin-seaters/naboo-n1">N1 Starfighter</Link>
      </Breadcrumbs.Item>
    </Breadcrumbs>
  );
};

FAQs

Package last updated on 28 Jun 2024

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