Path Reference field

The pathReference field is used to reference an existing file in the file system. It renders a combobox in the Admin UI.

You can define a glob pattern option to restrict which files can be selected, as shown in the example below.

Usage example

videoFile: fields.pathReference({
  label: 'Video file',
  description: 'A reference to a video file in the `public` folder',
  pattern: 'public/**/*',
}),

Type signature

Find the latest version of this field's type signature at: https://docsmill.dev/npm/@keystatic/core@latest#/.fields.pathReference