Feb. 23, 2023, 3:44 p.m. | Jordan Brennan

DEV Community dev.to

If you're familiar with my Mdash project, you've seen how I prefer to leverage HTML whenever possible. In this post I'm gonna share one of the ways I create Web Component-like elements without any JavaScript by "faking" slot elements.





What is a <slot> element?


The <slot> element is kind of like a generic container element similar to <div>, but its purpose is to define a place where another element will go. The element to replace the slot must have a …

container css hack html javascript project share web webcomponents webdev what is

Senior Security Engineer

@ LiquidX | Singapore, Central Singapore, Singapore

Application Security Engineer

@ Solidigm | Zapopan, Mexico

Application Security Engineer

@ Yassir | worldwide

Senior Windows Threat & Detection Security Researcher (Cortex)

@ Palo Alto Networks | Tel Aviv-Yafo, Israel

MDR Security Analyst

@ SentinelOne | Israel

Principal Security Research Engineer (Prisma Cloud)

@ Palo Alto Networks | Bengaluru, India