This project is still a work in progress.

payload bricks
Fields

Button group

List of buttons

Installation

npx shadcn@latest add https://payload-bricks.bblank.dev/r/button-group-field.json

Usage

example-config.ts
import { buttonGroupField } from "@/fields/button-group"
import type { Block } from "payload"

export const ExampleBlock: Block = {
  slug: "example",
  interfaceName: "Example",
  fields: [
    // your other fields
    buttonGroupField,
  ],
}
example-block.tsx
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

nametype
buttonsarraybutton field

On this page