-1

I copy this example from the doc enter image description here

and I want to add divider between them, but whereever I add the divider, it does not work. How can I add divider between list items?

2
  • 1
    You can just add border-bottom: 1px solid <color> Commented Sep 7, 2022 at 10:35
  • 1
    Please provide enough code so others can better understand or reproduce the problem. Commented Sep 7, 2022 at 17:57

2 Answers 2

1

I think you can try component of Material UI and check if(index === 0 || index !== (list.length - 1)) => not render

Sign up to request clarification or add additional context in comments.

Comments

0

.item {
   margin-top: 10px;
   border-top: 1px solid black;
   padding-top: 10px;
}

.item:first-child {
   margin-top: 0;
   border-top: none;
   padding-top: 0;
}
///map your list components like this.ssssssssssssssssssssssssssssssss



<ul className="list">
  {array.map((item) => (
    <li key={item.id} className="item"><Item item={item} /></li>
  )}
</ul>

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.