Astro components

Is it possible to pass complex objects into astro components as props?
3 Replies
MarkBoots
MarkBoots3mo ago
not experienced with astro, but you might want to provide an example of what you would like to acchieve
TheOneThatPlaysTooMuch
For example take this hypothetical icon component:
<Icon size= { xSize = 3px, ySize = 3px }></Icon>
<Icon size= { xSize = 3px, ySize = 3px }></Icon>
is there a way to make that work?
Jono Lewarne
Jono Lewarne3mo ago
Yes what you’re trying to do is very simple in Astro. See the docs here https://docs.astro.build/en/basics/astro-components/#component-based-design
Docs
Components
An intro to the .astro component syntax.

Did you find this page helpful?