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

buildkit-primevue

v0.1.94

Published

FormKit components and helpers built on PrimeVue v4 with Tailwind CSS

Readme

buildkit-primevue

FormKit-powered form components and helpers built on PrimeVue v4 and Tailwind CSS. Provides a single drop-in <FormKit> component with a typed configuration schema, field utilities, and visibility helpers. Ships with first-class TypeScript support and friendly defaults.

  • Vue 3 + PrimeVue v4
  • Tailwind CSS 4-ready
  • Default import for FormKit: import FormKit from 'buildkit-primevue'
  • Utilities for mapping incoming data to fields and extracting a clean payload
  • Bundled type definitions — no custom declarations needed

Table of Contents

  • Requirements
  • Installation
  • Quick Start
  • Usage Examples
    • Minimal example
    • With utilities (setFields, getPayload)
    • Global plugin registration
    • Subpath imports
  • Types
  • Field schema basics
  • Utilities
  • Visibility helpers
  • Troubleshooting
  • Contributing
  • License

Requirements

  • Vue >= 3.4
  • PrimeVue >= 4.0.0
  • @primevue/forms >= 4.0.0
  • Tailwind CSS >= 4 (recommended) and tailwindcss-primeui (optional)

See peerDependencies in package.json for the full list.

Installation

Install the package and the required peers:

npm i buildkit-primevue primevue @primevue/forms @primevue/themes @primeuix/themes @primeuix/utils vue
# optional but recommended if you use Tailwind v4
npm i -D tailwindcss @tailwindcss/vite @tailwindcss/postcss tailwindcss-primeui

Make sure PrimeVue and a theme are set up in your app entry per PrimeVue docs.

Quick Start

You can import FormKit as a default import without curly braces:

<script setup lang="ts">
import FormKit from 'buildkit-primevue';
import type { FormKitProps } from 'buildkit-primevue';
import { ref, reactive } from 'vue';

const form = ref<Record<string, any>>({});
const fields: FormKitProps['fields'] = {
  name: { label: 'Name', as: 'InputText', required: true, colSpan: { mobile: 12, tablet: 12, desktop: 12 }, vertical: false, style: {} },
};

const args = reactive<FormKitProps>({ fields, size: 'small' });
</script>

<template>
  <FormKit v-model="form" v-bind="args" />
</template>

Usage Examples

1) Minimal example

<script setup lang="ts">
import FormKit from 'buildkit-primevue';
import type { FormKitProps } from 'buildkit-primevue';

const fields: FormKitProps['fields'] = {
  email: { label: 'Email', as: 'InputText', schema: 'required|email', colSpan: { mobile: 12, tablet: 12, desktop: 12 }, vertical: false, style: {} },
};
</script>

<template>
  <FormKit :fields="fields" />
</template>

2) With utilities (setFields, getPayload)

<script setup lang="ts">
import FormKit, { setFields, getPayload } from 'buildkit-primevue';
import type { FormKitProps } from 'buildkit-primevue';
import { ref, reactive, onMounted } from 'vue';

const form = ref<Record<string, any>>({});
const fields: FormKitProps['fields'] = {
  project: { label: 'Project', as: 'InputText', colSpan: { mobile: 12, tablet: 12, desktop: 12 }, vertical: false, style: {} },
  desired_m2: { label: 'Desired m²', as: 'InputNumber', type: 'number', colSpan: { mobile: 12, tablet: 6, desktop: 6 }, vertical: false, style: {} },
};

const args = reactive<FormKitProps>({ fields, size: 'small' });

onMounted(() => {
  // Prefill form defaults from API data
  setFields({ project: 'sample1', desired_m2: 70 }, fields);
});

function submit({ valid, states }: any) {
  const payload = getPayload(states);
  if (valid) {
    console.log('Submitting', payload);
  } else {
    console.log('Invalid', payload);
  }
}
</script>

<template>
  <FormKit v-model="form" v-bind="args" @submit="submit" />
</template>

3) Global plugin registration

If you prefer global registration of components:

// main.ts
import { createApp } from 'vue';
import App from './App.vue';
import { BuildKitPrimeVue } from 'buildkit-primevue';

createApp(App)
  .use(BuildKitPrimeVue)
  .mount('#app');

After this, <FormKit/> and related components are globally available.

4) Subpath imports

You can also import specific components via subpaths (with types):

import FormKit from 'buildkit-primevue/FormKit';
import FormKitControl from 'buildkit-primevue/FormKitControl';

Types

This package ships its own TypeScript definitions. No need to install @types/buildkit-primevue or add custom module declarations.

Useful types you can import:

  • FormKitProps
import type { FormKitProps } from 'buildkit-primevue';

Field schema basics

Each field accepts a config object. Common properties include:

  • label: string
  • as: component name (e.g., InputText, InputNumber, Checkbox, RadioButton, Select)
  • schema: validation rules string (e.g., "required|max:12|email")
  • defaultValue: any
  • colSpan: { mobile, tablet, desktop }
  • vertical: boolean (layout for group inputs)
  • options: for selectables
  • showWhen/hideWhen: conditional visibility

Example field configuration:

const fields: FormKitProps['fields'] = {
  name: {
    label: 'Name',
    as: 'InputText',
    schema: 'required|min:2',
    defaultValue: '',
    colSpan: { mobile: 12, tablet: 6, desktop: 6 },
    vertical: false,
    style: {},
  },
  country: {
    label: 'Country',
    as: 'Select',
    options: [
      { label: 'Japan', value: 'JP' },
      { label: 'Türkiye', value: 'TR' },
    ],
    colSpan: { mobile: 12, tablet: 6, desktop: 6 },
    vertical: false,
    style: {},
  },
};

Utilities

  • setFields(data, fields)
    • Maps an incoming object (e.g., from an API) to your field defaults using safe value casting.
  • getPayload(states)
    • Reads PrimeVue FormFieldState objects and returns a clean payload with values cast to sensible types.
  • setDynamicFields(columns)
    • Transforms a column/config array into a fields map. Copies rules to schema automatically for non-checkboxes.

Import from the main entry:

import { setFields, getPayload, setDynamicFields } from 'buildkit-primevue';

Visibility helpers

Two helpers are exported for conditional rendering logic:

  • equals(left, right) — strict equality with smart casting for arrays and common string-to-boolean/number cases.
  • includesMatch(left, right | right[]) — substring match for strings or membership for arrays/scalars with casting.
import { equals, includesMatch } from 'buildkit-primevue';

Troubleshooting

  • I can’t import FormKit without curly braces.
    • Ensure you’re using import FormKit from 'buildkit-primevue'. The default export is the component itself.
  • TypeScript can’t find types.
    • Types are bundled. Confirm your tooling resolves package types (no custom declare module needed).
  • PrimeVue components aren’t styled.
    • Make sure you installed and configured a PrimeVue theme per PrimeVue docs and that Tailwind is set up if you use Tailwind classes.

Contributing

PRs and issues are welcome. Please open a discussion or issue for significant changes.

License

MIT


Repository: https://github.com/thekubilay/buildkit-primevue