Under active development — things may change.

Link

A slightly modified version of link.ts from the Payload website template. The original can be found here.

Usage

TypeScript
1import { link } from '@/src/payload/fields/link';
2
3// Basic usage
4link()
5
6// With options
7link({
8  appearances: ['default', 'outline'],
9  localizedLabel: true,
10  required: true,
11})

Note: The import path above reflects the LayoutBlocks repo structure. Adjust it to match where you place the field file in your own project.

Props

PropTypeDefaultDescription
appearancesLinkAppearances[] | false['default', 'outline']Which appearance options to show. Pass false to hide.
disableLabelbooleanfalseRemoves the label field from the group.
localizedLabelbooleanfalseMakes the label field localizable.
overridesPartial<GroupField>{}Deep-merged into the generated group field.
requiredbooleanfalseMakes the reference/URL and label fields required.

What's Different

  • localizedLabel — Added prop that passes localized: true to the label text field when enabled.
  • required — Added prop that makes the reference, URL, and label fields required when enabled.