DEV Community

njd5435
njd5435

Posted on

Slots

Slots is definitely a topic that when I first started working with them and seeing them in code, I was left utterly confused. After working with a team and taking a web components class, slots aren't as hard as I originally saw them as and have learned how to use them. Currently, my team is working with cards such as the one attached.
Image description

Example of slots in our Card

While I am currently focused on the Icon portion of the project, the example I am attaching in our code is within the card banner section because of how organized it is and the use of it. There are two slots defined in this as name slots. Using slots it allows us to have structure and share content within the elements that are created. Slots are more clear to read and use.
Image description

github link: https://github.com/njd5435/project-two/blob/master/src/SciCardBanner.js

Top comments (0)