This package contains the official themes for FormKit. Read the installation documentation for more information.
Returns a function responsible for loading an icon by name.
createIconHandler(iconLoader?: FormKitIconLoader, iconLoaderUrl?: FormKitIconLoaderUrl): FormKitIconLoader;
iconLoader
optional — a function for loading an icon when it's not found in the iconRegistry.iconLoaderUrl
optional — a function that returns a remote URL for retrieving an SVG icon by name.Creates the theme plugin based on a given theme name.
createThemePlugin(theme?: string, icons?: Record<string, string | undefined>, iconLoaderUrl?: FormKitIconLoaderUrl, iconLoader?: FormKitIconLoader): (node: FormKitNode) => any;
theme
optional — The name or id of the theme to apply.icons
optional — Icons you want to add to the global icon registry.iconLoaderUrl
optional — A function that returns a remote url for retrieving an SVG icon by name.iconLoader
optional — A function that handles loading an icon when it is not found in the registry.A function to generate FormKit class functions from a JavaScript object.
generateClasses(classes: Record<string, Record<string, string>>): Record<string, string | FormKitClasses | Record<string, boolean>>;
classes
— An object of input types with nested objects of sectionKeys and class lists.An object of sectionKeys with class functions.
A function that returns an icon SVG string.
interface FormKitIconLoader {
(iconName: string): string | undefined | Promise<string | undefined>;
}
A function that returns a remote URL for retrieving an SVG icon by name.
interface FormKitIconLoaderUrl {
(iconName: string): string | undefined;
}