Security News
JSR Working Group Kicks Off with Ambitious Roadmap and Plans for Open Governance
At its inaugural meeting, the JSR Working Group outlined plans for an open governance model and a roadmap to enhance JavaScript package management.
@react-aria/breadcrumbs
Advanced tools
@react-aria/breadcrumbs is a React library that provides accessible breadcrumb navigation components. It is part of the React Aria collection, which focuses on providing accessible UI components that adhere to WAI-ARIA standards.
Basic Breadcrumbs
This feature allows you to create a basic breadcrumb navigation component. Each `Item` represents a breadcrumb link.
import { Breadcrumbs, Item } from '@react-aria/breadcrumbs';
function BreadcrumbExample() {
return (
<Breadcrumbs>
<Item key="home">Home</Item>
<Item key="about">About</Item>
<Item key="contact">Contact</Item>
</Breadcrumbs>
);
}
Custom Separator
This feature allows you to customize the separator between breadcrumb items. In this example, the separator is set to '>'.
import { Breadcrumbs, Item } from '@react-aria/breadcrumbs';
function CustomSeparatorExample() {
return (
<Breadcrumbs separator=">">
<Item key="home">Home</Item>
<Item key="about">About</Item>
<Item key="contact">Contact</Item>
</Breadcrumbs>
);
}
Breadcrumbs with Icons
This feature allows you to include icons in your breadcrumb items. Each `Item` can contain both an icon and text.
import { Breadcrumbs, Item } from '@react-aria/breadcrumbs';
import { HomeIcon, InfoIcon, ContactIcon } from './icons';
function BreadcrumbsWithIcons() {
return (
<Breadcrumbs>
<Item key="home"><HomeIcon /> Home</Item>
<Item key="about"><InfoIcon /> About</Item>
<Item key="contact"><ContactIcon /> Contact</Item>
</Breadcrumbs>
);
}
react-breadcrumbs-dynamic is a flexible and customizable breadcrumb component for React. It allows for dynamic generation of breadcrumbs based on the current route. Compared to @react-aria/breadcrumbs, it offers more flexibility in terms of dynamic breadcrumb generation but may require additional effort to ensure accessibility.
react-router-breadcrumbs-hoc is a higher-order component for generating breadcrumbs based on React Router routes. It is specifically designed to work with React Router, making it a good choice for applications that use React Router for navigation. However, it may not provide the same level of accessibility out-of-the-box as @react-aria/breadcrumbs.
react-breadcrumbs is a simple and lightweight breadcrumb component for React. It is easy to use and integrates well with React Router. While it is straightforward to implement, it may lack some of the advanced accessibility features provided by @react-aria/breadcrumbs.
This package is part of react-spectrum. See the repo for more details.
FAQs
Spectrum UI components in React
The npm package @react-aria/breadcrumbs receives a total of 623,612 weekly downloads. As such, @react-aria/breadcrumbs popularity was classified as popular.
We found that @react-aria/breadcrumbs demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 2 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
At its inaugural meeting, the JSR Working Group outlined plans for an open governance model and a roadmap to enhance JavaScript package management.
Security News
Research
An advanced npm supply chain attack is leveraging Ethereum smart contracts for decentralized, persistent malware control, evading traditional defenses.
Security News
Research
Attackers are impersonating Sindre Sorhus on npm with a fake 'chalk-node' package containing a malicious backdoor to compromise developers' projects.