Skip to content

Displaying an object array as a series of cards #1843

Answered by balazskosi
GatsbyFitz asked this question in Q&A
Discussion options

You must be logged in to vote

You can use an inline expression to interpolate the cards into the Markdown.

---
title: Displaying an object array as a series of cards
---

```js
const data = FileAttachment("data/Products.csv").csv()
```

${data.map(item => html`
    <div class="card">
        <h3>${item.planId}</h3>
        <p>${item.brand}</p>
    </div>
`)}

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@GatsbyFitz
Comment options

Answer selected by GatsbyFitz
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants