← Back to all updates // Oct 20, 2022
With Makeswift’s API you can map visual controls to your React component’s props to make your Next.js app visually editable. We provide controls like `Style`, `Shape`, `List`, `Combobox`, and more, so you can get the props you need without having to refactor your components.
For many components, one of the most important props is `children`, which usually expects a `ReactNode`. Until now Makeswift has not had a control that allows you to visually edit this prop.
With the latest version of `@makeswift/runtime`, we’ve introduced the `Slot` control. This control allows your components to receive `ReactNode` as props, unlocking visual composition for your custom components. `Slot` is powered by the same layout technology that powers our Box component.
To get the `Slot` control, upgrade to the latest version of `@makeswift/runtime`
npm upgrade @makeswift/runtime@latest
Or if you’re using Yarn
yarn upgrade @makeswift/runtime@latest
IMPORTANT: If you’re still on version v0.1 make sure to read our migration instructions for v0.2!
Using the Slot control to build a Disclosure component
Limitations of Slot
Currently the `Slot` control cannot be used with the `Shape` and `List` controls. For example, if you wanted to provide a `slides` prop for a carrousel component that was a `ReactNode[]`, you would not be able to use `List({ type: Slot() })` to achieve that. We're working to fix this limitation. Stay tuned!
Don't have a Next.js project yet? Get started with our no code builder and extend when you're ready.