Installation
This guide will help you install and configure Pantanal Grid in your Vue 3 project.
Prerequisites
- Node.js ≥ 18
- Vue 3 ≥ 3.3.0
- A package manager (npm, yarn, or pnpm)
Install the Package
# npm
npm install @pantanal/grid
# yarn
yarn add @pantanal/grid
# pnpm
pnpm add @pantanal/gridInstall Peer Dependencies
Required
Vue 3 is required:
npm install vue@^3.3.0Optional Dependencies
Excel Export
For Excel export functionality:
npm install xlsx@^0.18.5PDF Export
For PDF export functionality:
npm install jspdf@^2.5.0 html2canvas@^1.4.0Styling (Recommended)
While Pantanal Grid works without Tailwind CSS, it's recommended for better styling:
npm install -D tailwindcss postcss autoprefixerThen initialize Tailwind:
npx tailwindcss init -pImport Styles
Import the default stylesheet in your application entry point:
// main.ts
import { createApp } from 'vue'
import App from './App.vue'
import '@pantanal/grid/styles.css'
createApp(App).mount('#app')TypeScript Support
Pantanal Grid is written in TypeScript and includes type definitions. If you're using TypeScript, types will be automatically available.
Verify Installation
Create a simple test component to verify the installation:
<script setup lang="ts">
import { PantanalGrid, type ColumnDef } from '@pantanal/grid'
const rows = [
{ id: 1, name: 'Test', value: 100 }
]
const columns: ColumnDef[] = [
{ field: 'id', title: 'ID' },
{ field: 'name', title: 'Name' },
{ field: 'value', title: 'Value' }
]
</script>
<template>
<PantanalGrid :rows="rows" :columns="columns" key-field="id" />
</template>If the grid renders correctly, your installation is successful!
Troubleshooting
Styles Not Loading
Make sure you've imported the stylesheet:
import '@pantanal/grid/styles.css'TypeScript Errors
Ensure you're using Vue 3.3.0 or higher and have TypeScript properly configured in your project.
Build Errors
If you encounter build errors, make sure all peer dependencies are installed and compatible with your project's versions.