You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Yes—pass your router’s `<Link>` as `LinkComponent`. The UI is MUI; navigation is your router.
220
+
221
+
**How do I change the last crumb’s style?**
222
+
The last item usually has no `href`. You can add conditional styles by checking `href` presence in your `items` or wrap this component with your own style logic.
223
+
224
+
**Can I disable icons entirely?**
225
+
Yes—don’t pass `icon` and set`homeLabel` to a non-matching value.
226
+
227
+
---
228
+
229
+
## Accessibility & SEO
230
+
231
+
This component previously supported `schema.org` microdata via a `withSchema` and `withJsonLd` prop. These have been **removed**for the following reasons:
232
+
233
+
- ⚠️ **Google no longer consistently indexes client-side microdata** (e.g. via React or `dangerouslySetInnerHTML`) unless it's rendered server-side.
234
+
- 🧼 Breadcrumb JSON-LD tags added via `<script>` often **conflict with route-based apps** (e.g. dynamic segments in Next.js).
235
+
- 🔍 Most modern SEO guidance encourages **server-side or static rendering** of JSON-LD, not runtime injection.
236
+
- 🔧 Removing these props results in **simpler DOM output**, cleaner markup, and improved developer control.
237
+
238
+
**If you need structured breadcrumbs for SEO**, we recommend injecting them at the page level with your own layout component, using `<script type="application/ld+json">` manually for static pages only.
239
+
240
+
This component still provides:
241
+
242
+
- Accessible markup (`aria-label`, correct role semantics)
243
+
- Customizable separator, label, and icon logic
244
+
- Dynamic routing support via the `items` prop or `usePathBreadcrumbs` helper
245
+
246
+
247
+
## Contributing
248
+
249
+
* CI badge above expects a workflow at `.github/workflows/ci.yml`.
250
+
* Please run `npm run build` before sending a PR.
251
+
* Keep peer ranges broad enough for MUI 7 / React 18–19.
252
+
253
+
---
254
+
255
+
## License
256
+
257
+
[MIT](LICENSE)
258
+
259
+
260
+
Here are the two new README sections you asked for, ready to paste.
261
+
262
+
---
263
+
264
+
## GitHub Action Pipeline
265
+
266
+
This project ships with two CI workflows—one for `main` and one for `dev`—that run a strict, fail-fast build and test matrix.
267
+
268
+
**What the pipeline does**
269
+
270
+
1. **Checkout & Node setup (Node 20)**
271
+
2. **Install** with `npm ci` (immutable lockfile)
272
+
3. **Typecheck** with `tsc --noEmit`
273
+
4. **Build** with `tsup` (ESM + CJS + d.ts)
274
+
5. **Test** with Vitest (jsdom + RTL)
275
+
276
+
**Why it’s strict**
277
+
278
+
* **Fail-fast**: any step error stops the job immediately
279
+
* **Immutable installs**: reproducible builds with `npm ci`
280
+
* **Matrix (optional)**: enable Node 18/20 if you need multi-runtime parity
> Tip: Keep your PRs green by running these before pushing.
299
+
300
+
---
301
+
302
+
## Automated Tests
303
+
304
+
The test stack is **Vitest + jsdom + React Testing Library** with a lightweight **Next.js Link mock** so components render without a Next runtime.
305
+
306
+
**Key pieces**
307
+
308
+
* **Vitest globals & jsdom** are enabled via `vitest.config.ts` and a `vitest.setup.ts` that loads Jest-DOM matchers.
309
+
* **Next Link mock**: tests import a tiny `<Link>` that renders to an anchor. This allows `<Breadcrumbs>` to use a `LinkComponent` without pulling in Next.
310
+
* **Component under test**: the MUI-based `<Breadcrumbs>` renders items, home icon behavior, separators, and current page semantics.
0 commit comments