Fields
Button group
List of buttons
Installation
npx shadcn@latest add https://payload-bricks.bblank.dev/r/button-group-field.jsonUsage
import { buttonGroupField } from "@/fields/button-group"
import type { Block } from "payload"
export const ExampleBlock: Block = {
slug: "example",
interfaceName: "Example",
fields: [
// your other fields
buttonGroupField,
],
}import { CMSButton } from "@/components/cms-button"
import type { Example } from "@/payload-types"
export function ExampleBlock(props: Example) {
return (
<div className="flex flex-wrap gap-3">
{props.buttons?.map(({ id, button }) =>
button ? <CMSButton key={id} {...button} /> : null
)}
</div>
)
}Field structure
| name | type | |
|---|---|---|
buttons | array | button field |