Pages Kit-Properties
Hey team, we’re building out an Marketplace component. The core idea is we’ve got a main React component that renders a series of cards. What we’d like to do is use the Add Property → Array feature in the Pages Kit panel to inject items into that component, instead of hardcoding every card.
So basically:
- We have our main component code written.
- We want the panel (where we can add JSON/array props) to feed directly into our component as
items. - That way we can add new cards through the editor instead of editing code every time.
Can you point us to docs or an example of how this panel → props wiring is intended to work? Specifically: how to structure the schema so the editor values are passed correctly into the component?
Thanks!
2 条回复
You can refer to the configuration in the image below. In the properties panel, add a
listproperty and select the type as anArray. At this point, you will see theAdd Sub Propertybutton, which allows you to add properties for elements in the array. In my screenshot, I configured two properties:titleanddesc.At this time, Pages Kit will automatically generate an editing interface for the array. In the component code, you can obtain the configuration data from props through
list. The screenshot shows that the data structure received by the component is consistent with theAdd Sub Property.If you have any questions, please let us know.
thank you. works great! my life just got so much easier! I assume it is a similar method for .json and the rest?