UNPKG

@amsterdam/design-system-react

Version:

All React components from the Amsterdam Design System. Use it to compose pages in your website or application.

15 lines (14 loc) 1.01 kB
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime"; import { clsx } from 'clsx'; import { forwardRef, useId } from 'react'; import { BreadcrumbLink } from './BreadcrumbLink'; const BreadcrumbRoot = forwardRef(({ accessibleName, accessibleNameId, children, className, ...restProps }, ref) => { const generatedId = useId(); const labelId = accessibleNameId || generatedId; return (_jsxs("nav", { ...restProps, "aria-labelledby": labelId, className: clsx('ams-breadcrumb', className), ref: ref, children: [_jsx("h2", { "aria-hidden": true, className: "ams-visually-hidden", id: labelId, children: accessibleName || 'Kruimelpad' }), _jsx("ol", { className: "ams-breadcrumb__list", children: children })] })); }); BreadcrumbRoot.displayName = 'Breadcrumb'; /** * @see {@link https://designsystem.amsterdam/?path=/docs/components-navigation-breadcrumb--docs Breadcrumb docs at Amsterdam Design System} */ export const Breadcrumb = Object.assign(BreadcrumbRoot, { Link: BreadcrumbLink });