
Security News
Deno 2.2 Improves Dependency Management and Expands Node.js Compatibility
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
@purpurds/breadcrumbs
Advanced tools
import { Meta, Stories, ArgTypes, Primary, Subtitle } from "@storybook/blocks";
import { Meta, Stories, ArgTypes, Primary, Subtitle } from "@storybook/blocks";
import * as BreadcrumbsStories from "./src/breadcrumbs.stories"; import packageInfo from "./package.json";
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.
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.
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 />
.
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
Unknown package
The npm package @purpurds/breadcrumbs receives a total of 2,392 weekly downloads. As such, @purpurds/breadcrumbs popularity was classified as popular.
We found that @purpurds/breadcrumbs demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
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.
Security News
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
Security News
React's CRA deprecation announcement sparked community criticism over framework recommendations, leading to quick updates acknowledging build tools like Vite as valid alternatives.
Security News
Ransomware payment rates hit an all-time low in 2024 as law enforcement crackdowns, stronger defenses, and shifting policies make attacks riskier and less profitable.