PrimeVue v3 Documentation

website·Indexed 35 days ago

https://v3.primevue.org

Documentation for PrimeVue v3, a UI component library for Vue.js by PrimeTek. Includes guides on installation with Vite and Nuxt, global configuration, theming, accessibility (WCAG 2), and Unstyled Mode. Features a comprehensive set of components including Dialog, Sidebar, Button, InputText, Dropdown, and VirtualScroller, along with the Pass Through (pt) API for styling.

Tokens
100.3K
Snippets
683
Records
807
Agent score
54%

What's inside PrimeVue

  1. Overview of PrimeVue UI Suite

    PrimeVue is a comprehensive UI component suite for Vue.js that provides a collection of UI components, icons, blocks, and application templates designed to increase developer productivity through reusable and customizable solutions.
  2. Overview of PrimeVue

    PrimeVue is a comprehensive UI component suite for Vue.js that provides a collection of UI components, icons, blocks, and application templates designed to increase developer productivity through reusable and customizable solutions.
  3. PrimeVue Accessibility Compliance Overview

    PrimeVue components are designed with WCAG 2.1 AA level compliance. For detailed accessibility information regarding specific components, developers should refer to the accessibility documentation provided for each individual component.
  4. Understand PrimeVue v3 Theming Architecture

    PrimeVue v3 uses a design-agnostic architecture where styling is split into two parts: the 'core' and the 'theme'. The core handles component structure and positioning, while the theme defines colors and spacing. Note that PrimeVue v4 introduces a completely new styled mode implementation.
  5. Understand PrimeVue v3 Theming Architecture

    PrimeVue v3 uses a design-agnostic architecture where styling is split into two parts: the core and the theme. The core handles component structure and positioning, while the theme defines colors and spacing. Note that PrimeVue v4 introduces a completely new styled mode implementation.
  6. PrimeVue Overview

    PrimeVue is a comprehensive UI suite for Vue.js providing over 80 customizable components. It supports both Styled mode (using pre-built themes like Material, Bootstrap, and PrimeOne) and Unstyled mode (allowing integration with CSS libraries like TailwindCSS). The library is built with first-class TypeScript support and is compliant with Web Content Accessibility Guidelines (WCAG 2.0).
  7. PrimeVue Accessibility Compliance Overview

    PrimeVue components are designed with WCAG 2.1 AA level compliance. For detailed accessibility information regarding specific components, developers should refer to the accessibility documentation provided for each individual component.
  8. Implement accessibility for Calendar

    The Calendar component supports screen readers via several methods:

    • Use a <label> with inputId prop.
    • Use aria-labelledby or aria-label props.
    • The component uses combobox role and manages aria-expanded and aria-controls for the popup.
    • Navigation buttons and timepicker spinners use labels derived from the global PrimeVue Locale configuration.
    <!-- Using Label -->
    <label for="date1">Date</label>
    <Calendar inputId="date1" />
    
    <!-- Using aria-labelledby -->
    <span id="date2">Date</span>
    <Calendar aria-labelledby="date2" />
    
    <!-- Using aria-label -->
    <Calendar aria-label="Date" />
  9. Import the RadioButton component

    To use the RadioButton component in a PrimeVue project, import it from the primevue/radiobutton module.
    import RadioButton from 'primevue/radiobutton';
  10. Integrate ContextMenu with DataTable

    To enable a right-click menu on rows, use the contextMenu property on the DataTable. Use v-model:contextMenuSelection to track the selected row and the @row-contextmenu event to trigger the menu opening logic.
    <ContextMenu ref="cm" :model="menuModel" />
    <DataTable v-model:contextMenuSelection="selectedProduct" :value="products" contextMenu @row-contextmenu="onRowContextMenu">
        <Column field="code" header="Code"></Column>
        <Column field="name" header="Name"></Column>
    </DataTable>
  11. Register PrimeVue components via CDN

    When using the CDN approach, each PrimeVue component must be included via its own script tag and then registered with the Vue application using app.component().
    <!-- 1. Include the component script -->
    <script src="https://unpkg.com/primevue/calendar/calendar.min.js"></script>
    
    <script>
      const { createApp } = Vue;
      const app = createApp({ /* ... */ });
    
      // 2. Register the component
      app.component('p-datepicker', primevue.calendar);
      
      app.mount('#app');
    </script>
  12. Group multiple Buttons using ButtonGroup

    Wrap multiple Button components inside a ButtonGroup component to group them together visually.
    <ButtonGroup>
        <Button label="Save" icon="pi pi-check" />
        <Button label="Delete" icon="pi pi-trash" />
        <Button label="Cancel" icon="pi pi-times" />
    </ButtonGroup>