From PrimeVue to PrimeReact: a design system is not a folder of components
What remains when the technology changes: visual contracts, accessibility, tokens and product decisions.
The problem
Libraries like PrimeVue and PrimeReact speed up building interfaces. The risk is calling a design system a collection of components used with different configurations on every screen.
The symptom shows up when the same decision is made again on every screen: one form shows the error message under the field, another uses a toast, a third paints the border red and writes nothing. All of them using the same library component.
One of the most cited early studies on this topic is Atomic Design (in Portuguese), by Brad Frost, which organizes the interface into atoms, molecules and organisms — a useful basis for thinking about composition, but one that, on its own, doesn't solve the product consistency a design system needs.
The layer that belongs to the product
A design system needs to define tokens, states, density, language, accessibility and interaction patterns. Instead of spreading the library's configurations around, product components can encapsulate the recurring decisions: a table with default pagination, a field with an error message, a modal with a consistent hierarchy.
Tokens are the easiest part to make explicit, because they don't depend on any framework:
:root {
--field-gap: 0.5rem;
--field-radius: 6px;
--field-border: #d0d5dd;
--field-border-invalid: #fda29b;
--field-error-fg: #b42318;
}
Product components, in turn, are where the decision becomes a contract. A form field with label, error and accessibility solved once, in PrimeVue:
<!-- FormField.vue -->
<script setup>
defineProps({ id: String, label: String, error: String });
const model = defineModel();
</script>
<template>
<div class="field">
<label :for="id">{{ label }}</label>
<InputText
:id="id"
v-model="model"
:invalid="Boolean(error)"
:aria-describedby="error ? `${id}-error` : undefined"
/>
<small v-if="error" :id="`${id}-error`" class="field-error">
{{ error }}
</small>
</div>
</template>
And the same contract in PrimeReact:
// FormField.tsx
interface FormFieldProps {
id: string;
label: string;
value: string;
error?: string;
onChange: (value: string) => void;
}
export function FormField({ id, label, value, error, onChange }: FormFieldProps) {
return (
<div className="field">
<label htmlFor={id}>{label}</label>
<InputText
id={id}
value={value}
invalid={Boolean(error)}
aria-describedby={error ? `${id}-error` : undefined}
onChange={(event) => onChange(event.target.value)}
/>
{error && (
<small id={`${id}-error`} className="field-error">
{error}
</small>
)}
</div>
);
}
That layer also reduces the impact of a migration between Vue and React. The technical API changes — v-model becomes value and onChange, the template becomes JSX — but the contract stays the same: whoever uses FormField passes a label and an error, and the aria-describedby wiring happens without anyone having to remember it. The experience contracts can remain documented and tested.
Without hiding everything
Encapsulating doesn't mean creating a generic wrapper with every possible property:
<!-- decides nothing: just forwards everything -->
<template>
<DataTable v-bind="$attrs">
<slot />
</DataTable>
</template>
When the inner component leaks entirely, the extra layer only increases maintenance: there are now two files to read before understanding a screen, and no decision was made in either of them. I prefer smaller abstractions, built from the patterns that really do repeat — if every table in the product has 20-item pagination, server-side sorting and an empty state with the same wording, that is what the product layer should pin down.
Conclusion for now
PrimeVue and PrimeReact offer parts. The design system begins when the team makes consistent decisions about how those parts represent the product — and manages to preserve those decisions even when the framework changes.