@madebywild/sanity-reference-collection-field
v1.3.1
Published
> [!IMPORTANT] > This package is primarily intended for internal use.
Readme
[!IMPORTANT] This package is primarily intended for internal use.
@madebywild/sanity-reference-collection-field
Sanity field for selecting and configuring predefined reference collections.
Install
pnpm add @madebywild/sanity-reference-collection-fieldConfigure Plugin
import { defineConfig } from "sanity";
import { wildSanityReferenceCollectionFieldPlugin } from "@madebywild/sanity-reference-collection-field";
export default defineConfig({
plugins: [
wildSanityReferenceCollectionFieldPlugin({
referenceKinds: [
"post",
{ title: "Projects", value: "project" },
{ title: "People", value: "person" },
],
}),
],
});Use in Schema
import { defineField } from "sanity";
defineField({
name: "feed",
type: "wild.referenceCollection",
options: {
inline: true,
extensions: {
filtering: true,
pagination: true,
},
},
});// Example editor value shape
{
collectionRef: "post",
options: {
pageCount: 12,
canLoadMore: true,
withFilters: true,
filterByKinds: ["post", "project"],
withPagination: true,
},
}