#Number of Slots
3 messages · Page 1 of 1 (latest)
Hi @safe whale. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:
Hmm, I don't know enough to give you a confident answer yet. The provided knowledge sources do not mention a direct way to get the number of slot elements passed to a component in Astro. However, Astro provides utility functions like Astro.slots.has() to check whether content for a specific slot name exists, and Astro.slots.render() to asynchronously render the contents of a slot to a string of HTML (source (https://docs.astro.build/en/reference/api-reference/#astroslots)).