npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@formitiva/core

v2.1.2

Published

Formitiva shared core — types, validation, registries and utilities (framework-agnostic)

Downloads

603

Readme

@formitiva/core

npm

Framework-agnostic shared core for Formitiva — types, validation, registries, utilities, styles, and themes used by all framework adapters.

You typically don't install this package directly. It is included as a dependency of @formitiva/react, @formitiva/vue, @formitiva/angular, and @formitiva/vanilla. Install it directly only when building a custom adapter or using the validation/utility layer standalone.

Installation

npm install @formitiva/core
# or
pnpm add @formitiva/core

What's Inside

Types & Model

Core TypeScript types that define the form schema:

  • FormitivaDefinition — the root form schema type (fields, groups, validation rules, visibility, computed values)
  • DefinitionPropertyField — individual field definition
  • FormitivaInstance — saved form state with user-entered values
  • FormitivaProps — common props shared by all framework adapters
  • FieldValidationMode"onEdit" | "onBlur" | "onSubmission"
import type { FormitivaDefinition, FormitivaInstance } from "@formitiva/core";

21 Built-in Field Types

text, string, multiline, password, email, date, time, url, phone, int, stepper, int-array, float, slider, float-array, unit, dropdown, multi-selection, color, rating, file

Each type has a built-in validator registered automatically.

Schema Utilities

import {
  validateDefinitionSchema,  // validate a definition object
  loadJsonDefinition,         // parse & validate from JSON string
  createInstanceFromDefinition,
  loadInstance,
  upgradeInstanceToLatestDefinition,
  serializeInstance,
  deserializeInstance,
} from "@formitiva/core";

Validation

import {
  validateField,
  validateFormValues,
  validateFieldWithCustomHandler,
  ensureBuiltinFieldTypeValidatorsRegistered,
} from "@formitiva/core";

Registries

Pluggable registries for extending form behavior:

| Registry | Purpose | |---|---| | Validation handlers | registerFieldValidator, registerTypeValidator, registerFormValidator | | Submission handlers | registerSubmitter, registerSubmissionHandler | | Button handlers | registerButtonHandler, getButtonHandler | | Visibility handlers | registerVisibilityHandler — custom show/hide logic | | Computed value handlers | registerComputedValueHandler — derive values from other fields |

Field Visibility & Computed Values

import {
  updateVisibilityMap,
  updateVisibilityBasedOnSelection,
  applyVisibilityRefs,
  applyComputedRefs,
} from "@formitiva/core";

Unit Value Mapper

Conversion utilities for unit fields across multiple dimensions:

import {
  dimensionUnitsMap,       // units grouped by dimension
  dimensionUnitFactorsMap, // conversion factors
  dimensionUnitDisplayMap, // display labels
  convertTemperature,
  getUnitFactors,
} from "@formitiva/core";

Supported dimensions: length, mass, volume, area, speed, temperature, time, digital storage, frequency, and more.

Localization — 30 Languages

import {
  supportedLanguages,
  loadCommonTranslation,
  createTranslationFunction,
} from "@formitiva/core";

en, fr, de, es, it, pt, ja, ko, zh-cn, zh-tw, ru, uk, pl, nl, sv, da, no, fi, cs, sk, hu, ro, bg, el, tr, th, hi, id, ms, vi

Grouping Helpers

import { groupConsecutiveFields, renameDuplicatedGroups } from "@formitiva/core";

Styles & CSS Classes

// Programmatic access to all CSS class names
import { CSS_CLASSES, combineClasses } from "@formitiva/core/styles";
/* Base stylesheet */
@import "@formitiva/core/styles/formitiva.css";

20 Built-in Themes

Import any theme CSS file directly:

@import "@formitiva/core/themes/material.css";
@import "@formitiva/core/themes/material-dark.css";

Available themes: ant-design, ant-design-dark, blueprint, blueprint-dark, compact-variant, fluent, glass-morphism, high-contrast-accessible, ios-mobile, macos-native, material, material-dark, midnight-dark, modern-light, neon-cyber-dark, shadcn, soft-pastel, spacious-variant, tailwind, tailwind-dark

Or customize via CSS variables:

:root {
  --formitiva-color-primary: #3b82f6;
  --formitiva-color-error: #ef4444;
  --formitiva-border-radius: 8px;
}

Framework Adapters

| Package | Framework | |---|---| | @formitiva/react | React ≥17 | | @formitiva/vue | Vue ≥3.3 | | @formitiva/angular | Angular ≥18 | | @formitiva/vanilla | Vanilla JS |

Links

License

MIT