Skip to content

Input Plugins

Input plugins allow you to add custom Inputs to SnowCMS.

Your Input plugins should be in src/inputs.

  • Directorysrc
    • Directoryinputs
      • inputs.config.ts
      • example-input.tsx

See the Inputs Reference for additional information on how to create an Input.

example-plugin.tsx
import { defineInputPlugin } from '@binaryfrost/snowcms';
type ValueType = string;
interface SettingsType = {
required: boolean
}
export default defineInputPlugin<ValueType, SettingsType>({
name: 'example-plugin',
plugin: ({ logger }) => {
logger.log('This is an example plugin');
return {
// Your input ...
};
}
});
inputs.config.ts
import { defineInputPluginConfig } from '@binaryfrost/snowcms';
import examplePlugin from './example-plugin';
export default defineInputPluginConfig({
plugins: [
examplePlugin
]
});