Security News
PyPI’s New Archival Feature Closes a Major Security Gap
PyPI now allows maintainers to archive projects, improving security and helping users make informed decisions about their dependencies.
@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 395,282 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
PyPI now allows maintainers to archive projects, improving security and helping users make informed decisions about their dependencies.
Research
Security News
Malicious npm package postcss-optimizer delivers BeaverTail malware, targeting developer systems; similarities to past campaigns suggest a North Korean connection.
Security News
CISA's KEV data is now on GitHub, offering easier access, API integration, commit history tracking, and automated updates for security teams and researchers.