Skip to content

UI Themes

FormRenderer UI component

ts
import { FormRenderer } from '@macrulez/vue-form-schema/ui'

Props

PropTypeDefaultDescription
formUseFormReturnReturn value of useForm
componentsPartial<Record<FieldType, Component>>built-insOverride per-type renderers
submitLabelstring'Submit'Submit button text

Slots

SlotScopeDescription
#field-{name}{ field, value, error, touched, setValue, touch }Replace an entire field
#label-{name}{ field }Replace a label
#error-{name}{ field, error }Replace error display
#submit{ isSubmitting, isValid }Replace the submit button

Built-in field components

All exported individually from vue-form-schema/ui:

ComponentField types
TextFieldtext, email
NumberFieldnumber
TextareaFieldtextarea
SelectFieldselect
CheckboxFieldcheckbox
RadioFieldradio
DateFielddate
ArrayFieldarray
FileFieldfile

Tailwind UI theme

A drop-in replacement for FormRenderer using Tailwind utility classes — no custom CSS needed in your app. Requires Tailwind CSS installed and configured to scan library source files.

ts
import { TailwindFormRenderer } from '@macrulez/vue-form-schema/ui/tailwind'
vue
<!-- Same form, same schema — just swap the renderer -->
<TailwindFormRenderer :form="form" submit-label="Save" />

All field components are also exported individually:

ts
import {
  TwTextField,
  TwSelectField,
  TwCheckboxField,
  TwRadioField,
  TwFileField,
  TwArrayField,
  // …
} from '@macrulez/vue-form-schema/ui/tailwind'

shadcn / PrimeVue / Naive UI themes

Three more drop-in FormRenderer replacements for popular component libraries — same schema, same useForm, just swap the renderer.

ts
import { ShadcnFormRenderer } from '@macrulez/vue-form-schema/ui/shadcn'
import { PrimeVueFormRenderer } from '@macrulez/vue-form-schema/ui/primevue'
import { NaiveFormRenderer } from '@macrulez/vue-form-schema/ui/naive'
vue
<ShadcnFormRenderer :form="form" submit-label="Save" />
<PrimeVueFormRenderer :form="form" submit-label="Save" />
<NaiveFormRenderer :form="form" submit-label="Save" />
ThemeWhat it actually is
ui/shadcnNot a wrapper around importable shadcn-vue components — shadcn-vue ships as copy-paste source via its CLI, not as an npm component library, so there's nothing to import. This theme is Tailwind markup styled with shadcn/ui's own utility-class vocabulary (border-input, bg-primary, text-destructive, ring-ring, …). Drop it into a project that already has shadcn-vue's Tailwind theme tokens configured (npx shadcn-vue init) and it matches natively — same requirement as ui/tailwind for Tailwind CSS itself.
ui/primevueReal wrapper components around PrimeVue's own (InputText, Select, RadioButton, Checkbox, DatePicker, Message, Button, …). Requires primevue ^4 or ^5 installed and its Vue plugin registered (app.use(PrimeVue, { theme: { preset: Aura } }) or your own preset).
ui/naiveReal wrapper components around Naive UI's own (NInput, NSelect, NRadioGroup, NCheckbox, NDatePicker, NFormItem, NButton, …). Requires naive-ui ^2.38 installed; no global plugin needed.

File fields in the PrimeVue and Naive UI themes use a small self-contained native dropzone rather than <FileUpload> / <NUpload> — those components are built around actively uploading to a server, not just collecting File objects for later form submission.

All field components are also exported individually per theme, prefixed Sh* / Pv* / Nu* respectively (e.g. ShTextField, PvSelectField, NuCheckboxField).

Accessibility

All built-in field components include full a11y attributes:

FeatureHow
aria-requiredSet to "true" on required inputs, selects, textareas, fieldsets
aria-invalidSet to "true" when the field is touched and has errors
aria-describedbyPoints to "{name}-error" when errors are present
role="alert" + aria-live="polite"Error lists are announced by screen readers on appearance
label[for] + input[id]All inputs have matching label and id
fieldset + legendRadio groups use semantic grouping
aria-checkedCheckboxes reflect boolean state explicitly

SSR compatibility

The core (useForm, validators, parsers, ConditionEvaluator) does not use browser APIs. bindMask and FormRenderer use DOM APIs — wrap them in onMounted or <ClientOnly> when needed.