primevue-skilld
npx skills add https://github.com/harlan-zw/vue-ecosystem-skills --skill primevue-skilld
Agent 安装分布
Skill 文档
primefaces/primevue primevue
Version: 4.5.4 (Dec 2025) Deps: @primeuix/styled@^0.7.4, @primeuix/utils@^0.6.2, @primeuix/styles@^2.0.2, @primevue/core@4.5.4, @primevue/icons@4.5.4 Tags: v2-stable: 2.10.4 (Dec 2023), v3-stable: 3.53.1 (Dec 2024), latest: 4.5.4 (Dec 2025)
References: Docs â API reference, guides ⢠GitHub Issues â bugs, workarounds, edge cases ⢠Releases â changelog, breaking changes, new APIs
API Changes
This section documents version-specific API changes â prioritize recent major/minor releases.
-
BREAKING:
Calendarrenamed toDatePickerâ v3 component renamed toDatePickerin v4 source -
BREAKING:
Dropdownrenamed toSelectâ v3 component renamed toSelectin v4 source -
BREAKING:
Sidebarrenamed toDrawerâ v3 component renamed toDrawerin v4 source -
BREAKING:
OverlayPanelrenamed toPopoverâ v3 component renamed toPopoverin v4 source -
BREAKING:
InputSwitchrenamed toToggleSwitchâ v3 component renamed toToggleSwitchin v4 source -
BREAKING:
TabViewreplaced byTabsâ new component structure usingTabList,Tab,TabPanels, andTabPanelsource -
BREAKING:
Stepsreplaced byStepperâ new component structure usingStepList,Step,StepPanels, andStepPanelsource -
BREAKING:
Accordionreimplementation â now usesAccordionPanel,AccordionHeader, andAccordionContentcomponents source -
BREAKING:
v-model:valueâ v4 usesv-model:valuefor active state inTabs,Accordion, andStepperinstead ofv-modelsource -
DEPRECATED:
inputStyleâ property replaced byinputVariant(values: ‘filled’ | ‘outlined’) source -
NEW:
@primevue/formsâ new dedicated package for advanced form management and validation source -
NEW:
Fluidcomponent â layout component that makes descendants span full width source -
NEW:
IconField&InputIconâ new components to wrap inputs and icons for decorative purposes source -
NEW:
useId&useAttrSelectorâ new core composables for unique ID generation and attribute selectors source
Also changed: DataTable showClearButton default is false (v4.3.0) · IftaLabel new component for in-field labels · Checkbox added indeterminate state · OverlayBadge new component replaces Badge directive · InlineMessage component deprecated · iconPosition removed from IconField · warning property renamed to warn · Drawer added before-hide emit (v4.3.0)
Best Practices
- Use the
Fluidcomponent as a wrapper for bulk application of full-width styles to inputs instead of adding thefluidprop to every individual field for cleaner and more maintainable templates source
<Fluid>
<div class="grid grid-cols-2 gap-4">
<InputText placeholder="Full Width" />
<DatePicker placeholder="Full Width" />
<Select placeholder="Full Width" />
</div>
</Fluid>
-
In Stepper vertical layouts, always wrap
StepandStepPanelinside aStepItemcomponent to ensure correct structure and connection between headers and content source -
Use
asChildandv-sloton components likeSteporTabto implement headless mode for full UI control while retaining PrimeVue’s built-in accessibility logic source
<Step v-slot="{ activateCallback, value, a11yAttrs }" asChild :value="1">
<button @click="activateCallback" v-bind="a11yAttrs.header">
Step {{ value }}
</button>
</Step>
- For performant row expansion in
DataTablewith large datasets, use an object forexpandedRowscombined withdataKeyinstead of an array of row objects source
// Preferred (O(1) lookup)
const expandedRows = ref({ '1004': true, '1005': true });
// In template
<DataTable v-model:expandedRows="expandedRows" dataKey="id">
-
Enable automatic user preference persistence (sorting, filtering, paging) in
DataTableusingstateStorageandstateKeyto improve UX across page visits source -
Add a
delaytoVirtualScrollerto throttle rendering during rapid scrolling, significantly improving UI responsiveness for extremely large lists source
<VirtualScroller :items="items" :itemSize="50" :delay="250">
<template v-slot:item="{ item }">{{ item }}</template>
</VirtualScroller>
-
Implement semantic navigation menus by using
TabswithoutTabPanelsand combining it withrouter-linkfor accessible, state-aware top or side bars source -
Always wrap inputs and icons with
IconFieldandInputIconto ensure correct positioning and styling, supporting both leading and trailing icon placements source
<IconField>
<InputIcon class="pi pi-search" />
<InputText placeholder="Search" />
</IconField>
-
Use
IftaLabelfor modern, top-aligned in-field labels that visually integrate with the input and handle validation states automatically source -
Leverage the built-in
DataTablecontext menu integration to provide row-specific actions without manual event listener management or custom positioning logic source
<ContextMenu ref="cm" :model="menuModel" />
<DataTable :value="products" contextMenu @row-contextmenu="onRowContextMenu">