Skip to content

Getting started ​

Installation ​

For React:

bash
npm install @dynamic-field-kit/core @dynamic-field-kit/react

For Angular:

bash
npm install @dynamic-field-kit/core @dynamic-field-kit/angular

For Vue:

bash
npm install @dynamic-field-kit/core @dynamic-field-kit/vue

For Svelte 5:

bash
npm install @dynamic-field-kit/core @dynamic-field-kit/svelte

@dynamic-field-kit/core is a peer dependency of every adapter (as is your framework: react + react-dom, vue, svelte, or @angular/*). Install it explicitly, as shown above — the adapters no longer pull it in automatically. Keeping a single shared core version means all adapters resolve the same field registry.


Core Concepts ​

The library does NOT define field types like:

ts
'text' | 'number';

Instead, it exposes an extendable interface that applications can augment:

ts
export interface FieldTypeMap {}

This allows:

  • Unlimited custom field types
  • Strong typing without locking consumers
  • No need to rebuild the library

This pattern is used by mature libraries like MUI, React Hook Form, and Redux Toolkit.

Defining Field Types (App Side) ​

Create a .d.ts file in your app (e.g. src/types/dynamic-field.d.ts):

ts
import '@dynamic-field-kit/core';

declare module '@dynamic-field-kit/core' {
  interface FieldTypeMap {
    text: string;
    number: number;
    checkbox: boolean;
    select: string;
  }
}

⚠️ Make sure this file is included in tsconfig.json.


Released under the MIT License.