Please fill out as many of the following questions as possible so we can help you promptly! If you don’t know how to answer or it does not apply, feel free to remove it or leave it blank.
Builder content link
e.g. Builder.io: Visual Development Platform
Builder.io: Visual Development Platform
Builder public api key
bf5aeb09845647e5a8182770c0ca0fdc
What are you trying to accomplish
trying to use the on the pages
Screenshots or video link
Code stack you are integrating Builder with
NextJs*
Reproducible code example
If you are having integration errors, please link to codesandbox or copy and paste your problematic code here. The more detail the better!
import React from 'react';
import { Builder } from '@builder.io/react';
import {
Accordion,
AccordionContent,
AccordionItem,
AccordionTrigger,
} from "@/components/ui/accordion"
const AccordionList = ({ items }) => (
<div className="bg-white">
{items && items.length > 0 ? (
<Accordion type="single" collapsible className="w-full p-5">
{items?.map((item, index) => (
<AccordionItem key={index} value={item.value}>
<AccordionTrigger>{item.title}</AccordionTrigger>
<AccordionContent>{item.content}</AccordionContent>
hello
</AccordionItem>
))}
</Accordion>
) : <h2>Add Items</h2> }
</div>
);
Builder.registerComponent(AccordionList, {
name: 'AccordionList',
inputs: [
{
name: 'items',
type: 'list',
subFields: [
{
name: 'value',
type: 'text',
},
{
name: 'title',
type: 'text',
},
{
name: 'content',
type: 'richText',
},
],
},
],
});
export default AccordionList;