@madebywild/sanity-icon-field
v3.0.1
Published
> [!IMPORTANT] > This package is primarily intended for internal use.
Readme
[!IMPORTANT] This package is primarily intended for internal use.
@madebywild/sanity-icon-field
Sanity field type for selecting icons from a predefined list.
Install
pnpm add @madebywild/sanity-icon-fieldConfigure Plugin
import { defineConfig } from "sanity";
import { wildSanityIconFieldPlugin } from "@madebywild/sanity-icon-field";
export default defineConfig({
plugins: [
wildSanityIconFieldPlugin({
iconList: [
{ label: "Arrow Right", value: "arrow-right" },
{ label: "Play", value: "play" },
{ label: "Download", value: "download" },
],
renderValue: (value) => <span data-icon={value} />,
}),
],
});Use in Schema
import { defineField } from "sanity";
defineField({
name: "ctaIcon",
type: "wild.icon",
options: {
whitelist: ["arrow-right", "play"],
blacklist: ["download"],
},
});