Skip to content

Instantly share code, notes, and snippets.

@colepeters
colepeters / enhance-breadcrumbs.mjs
Last active April 4, 2024 18:30
Quick example of building a single Breadcrumbs component which takes it data from the store and returns accessible, valid markup
// app/elements/enhance-breadcrumbs.mjs
export default function EnhanceBreadcrumbs ({ html, state }) {
const { store } = state
const { breadcrumbs } = store
const items = breadcrumbs.map(b => `
<li>
<a href="${b.href}">
${b.label}
</a>

Keybase proof

I hereby claim:

  • I am colepeters on github.
  • I am cole (https://keybase.io/cole) on keybase.
  • I have a public key whose fingerprint is 0935 C978 8092 3F6F 2231 D1C1 DBD3 AD2C 6A91 A1A0

To claim this, I am signing this object: