# PaginationPanel

A comprehensive pagination control panel that combines page navigation, rows per page selection, and total records display in a unified interface.

## Features

- **Complete Pagination**: Includes page navigation, row count selector, and summary info
- **Customizable Row Options**: Configure available rows per page options
- **Total Information Display**: Show total records with customizable formatting
- **Multiple Alignments**: Support for left, right, and center alignment
- **Size Variants**: Normal and big size options
- **Style Integration**: Inherits styling from base Pagination component
- **Custom Info Generator**: Flexible total information display with custom formatting
- **Event Handling**: Separate handlers for page changes and row count changes

## Installation

```bash
npm install @ticatec/uniface-element
```

## Basic Usage

```svelte
<script>
  import PaginationPanel from '@ticatec/uniface-element/PaginationPanel';
  
  let currentPage = 1;
  let totalPages = 10;
  let totalRecords = 250;
  let rowsPerPage = 25;
  
  function handlePageChange(page) {
    currentPage = page;
    console.log('Page changed to:', page);
  }
  
  function handleRowCountChange(rows) {
    rowsPerPage = rows;
    // Recalculate total pages based on new row count
    totalPages = Math.ceil(totalRecords / rows);
    currentPage = 1; // Reset to first page
    console.log('Rows per page changed to:', rows);
  }
</script>

<PaginationPanel
  pageNo={currentPage}
  pageCount={totalPages}
  total={totalRecords}
  rowCount={rowsPerPage}
  onPageChange={handlePageChange}
  onRowCountChanged={handleRowCountChange}
/>
```

## API Reference

### Props

| Prop | Type | Default | Description |
|------|------|---------|-------------|
| `pageNo` | `number` | `1` | Current active page number |
| `pageCount` | `number` | `0` | Total number of pages |
| `total` | `number` | `null` | Total number of records |
| `rowCount` | `number` | `25` | Current rows per page setting |
| `rowsSet` | `Array<number>` | `[25, 50, 100]` | Available rows per page options |
| `type` | `'plain' \| 'round' \| 'circle'` | `'round'` | Visual style variant |
| `page$style` | `string` | `''` | Custom CSS styles for pagination component |
| `big` | `boolean` | `false` | Enable larger size variant |
| `rowCountLabel` | `string` | `'Rows/Page'` | Label for rows per page selector |
| `align` | `'left' \| 'right' \| ''` | `''` | Panel alignment |
| `generateInfo` | `GenerateTotalInfo \| null` | `null` | Custom function to generate total info text |
| `onPageChange` | `OnPageChange` | `undefined` | Page change event handler |
| `onRowCountChanged` | `OnRowCountChanged` | `undefined` | Row count change event handler |

### Types

```typescript
export type OnPageChange = (page: number) => void;
export type OnRowCountChanged = (rows: number) => void;
export type GenerateTotalInfo = (total: number, pageCount: number, pageNo: number, rows: number) => string;
```

## Examples

### Data Table with Full Pagination

```svelte
<script>
  import PaginationPanel from '@ticatec/uniface-element/PaginationPanel';
  
  let users = [];
  let currentPage = 1;
  let totalPages = 1;
  let totalUsers = 0;
  let rowsPerPage = 25;
  let loading = false;
  
  async function loadUsers(page = 1, rows = 25) {
    loading = true;
    
    try {
      // Simulate API call
      await new Promise(resolve => setTimeout(resolve, 500));
      
      // Mock data
      totalUsers = 237; // Total records from API
      totalPages = Math.ceil(totalUsers / rows);
      currentPage = page;
      
      const startIndex = (page - 1) * rows;
      users = Array.from({ length: Math.min(rows, totalUsers - startIndex) }, (_, i) => ({
        id: startIndex + i + 1,
        name: `User ${startIndex + i + 1}`,
        email: `user${startIndex + i + 1}@example.com`,
        role: ['Admin', 'User', 'Moderator'][Math.floor(Math.random() * 3)],
        status: Math.random() > 0.2 ? 'Active' : 'Inactive'
      }));
    } finally {
      loading = false;
    }
  }
  
  function handlePageChange(page) {
    loadUsers(page, rowsPerPage);
  }
  
  function handleRowCountChange(rows) {
    rowsPerPage = rows;
    loadUsers(1, rows); // Reset to page 1 with new row count
  }
  
  // Custom info generator
  function generateUserInfo(total, pageCount, pageNo, rows) {
    const start = (pageNo - 1) * rows + 1;
    const end = Math.min(pageNo * rows, total);
    return `Showing <b>${start}-${end}</b> of <b>${total}</b> users`;
  }
  
  // Load initial data
  loadUsers(currentPage, rowsPerPage);
</script>

<div class="user-management">
  <h2>User Management</h2>
  
  {#if loading}
    <div class="loading">Loading users...</div>
  {:else}
    <table class="users-table">
      <thead>
        <tr>
          <th>ID</th>
          <th>Name</th>
          <th>Email</th>
          <th>Role</th>
          <th>Status</th>
        </tr>
      </thead>
      <tbody>
        {#each users as user}
          <tr>
            <td>{user.id}</td>
            <td>{user.name}</td>
            <td>{user.email}</td>
            <td>{user.role}</td>
            <td class="status {user.status.toLowerCase()}">{user.status}</td>
          </tr>
        {/each}
      </tbody>
    </table>
  {/if}
  
  <PaginationPanel
    pageNo={currentPage}
    pageCount={totalPages}
    total={totalUsers}
    rowCount={rowsPerPage}
    rowsSet={[10, 25, 50, 100]}
    rowCountLabel="Users per page"
    generateInfo={generateUserInfo}
    onPageChange={handlePageChange}
    onRowCountChanged={handleRowCountChange}
    align="right"
  />
</div>

<style>
  .user-management {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
  }
  
  .loading {
    text-align: center;
    padding: 40px;
    color: #666;
  }
  
  .users-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
  }
  
  .users-table th,
  .users-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #ddd;
  }
  
  .users-table th {
    background-color: #f8f9fa;
    font-weight: 600;
  }
  
  .status.active {
    color: #28a745;
  }
  
  .status.inactive {
    color: #dc3545;
  }
</style>
```

### Product Catalog with Custom Styling

```svelte
<script>
  import PaginationPanel from '@ticatec/uniface-element/PaginationPanel';
  
  let products = [];
  let currentPage = 1;
  let totalPages = 1;
  let totalProducts = 0;
  let rowsPerPage = 12;
  let category = 'all';
  
  const categories = {
    all: 'All Products',
    electronics: 'Electronics',
    clothing: 'Clothing',
    books: 'Books'
  };
  
  async function loadProducts(page = 1, rows = 12, cat = 'all') {
    // Simulate API call with category filter
    const categoryTotals = {
      all: 180,
      electronics: 45,
      clothing: 67,
      books: 68
    };
    
    totalProducts = categoryTotals[cat];
    totalPages = Math.ceil(totalProducts / rows);
    currentPage = page;
    
    const startIndex = (page - 1) * rows;
    products = Array.from({ length: Math.min(rows, totalProducts - startIndex) }, (_, i) => ({
      id: startIndex + i + 1,
      name: `${categories[cat]} Product ${startIndex + i + 1}`,
      price: (Math.random() * 200 + 20).toFixed(2),
      image: `https://picsum.photos/200/200?random=${startIndex + i + 1}`,
      rating: (Math.random() * 2 + 3).toFixed(1)
    }));
  }
  
  function handlePageChange(page) {
    loadProducts(page, rowsPerPage, category);
  }
  
  function handleRowCountChange(rows) {
    rowsPerPage = rows;
    loadProducts(1, rows, category);
  }
  
  function handleCategoryChange() {
    loadProducts(1, rowsPerPage, category);
  }
  
  // Custom product info generator
  function generateProductInfo(total, pageCount, pageNo, rows) {
    return `
      <span style="color: #007bff;">Page ${pageNo}</span> of 
      <span style="color: #007bff;">${pageCount}</span> • 
      <span style="color: #28a745;">${total}</span> products total
    `;
  }
  
  // Load initial products
  loadProducts(currentPage, rowsPerPage, category);
</script>

<div class="product-catalog">
  <div class="catalog-header">
    <h2>Product Catalog</h2>
    <div class="category-filter">
      <label>Category:</label>
      <select bind:value={category} on:change={handleCategoryChange}>
        {#each Object.entries(categories) as [key, value]}
          <option value={key}>{value}</option>
        {/each}
      </select>
    </div>
  </div>
  
  <div class="products-grid">
    {#each products as product}
      <div class="product-card">
        <img src={product.image} alt={product.name} />
        <h3>{product.name}</h3>
        <div class="product-info">
          <span class="price">${product.price}</span>
          <span class="rating">⭐ {product.rating}</span>
        </div>
      </div>
    {/each}
  </div>
  
  <PaginationPanel
    pageNo={currentPage}
    pageCount={totalPages}
    total={totalProducts}
    rowCount={rowsPerPage}
    rowsSet={[6, 12, 24, 48]}
    rowCountLabel="Products per page"
    generateInfo={generateProductInfo}
    onPageChange={handlePageChange}
    onRowCountChanged={handleRowCountChange}
    type="round"
    big
  />
</div>

<style>
  .product-catalog {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
  }
  
  .catalog-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
  }
  
  .category-filter {
    display: flex;
    align-items: center;
    gap: 10px;
  }
  
  .category-filter select {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
  }
  
  .products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
    margin-bottom: 40px;
    min-height: 400px;
  }
  
  .product-card {
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 16px;
    text-align: center;
    transition: transform 0.2s;
  }
  
  .product-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  }
  
  .product-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 4px;
    margin-bottom: 12px;
  }
  
  .product-card h3 {
    margin: 0 0 12px 0;
    font-size: 16px;
  }
  
  .product-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
  }
  
  .price {
    font-size: 18px;
    font-weight: bold;
    color: #007bff;
  }
  
  .rating {
    color: #ff9500;
  }
</style>
```

### Reports Dashboard

```svelte
<script>
  import PaginationPanel from '@ticatec/uniface-element/PaginationPanel';
  
  let reports = [];
  let currentPage = 1;
  let totalPages = 1;
  let totalReports = 0;
  let rowsPerPage = 15;
  let dateRange = 'week';
  
  async function loadReports(page = 1, rows = 15, range = 'week') {
    // Simulate loading reports based on date range
    const rangeTotals = {
      today: 23,
      week: 156,
      month: 642,
      year: 7834
    };
    
    totalReports = rangeTotals[range];
    totalPages = Math.ceil(totalReports / rows);
    currentPage = page;
    
    const startIndex = (page - 1) * rows;
    reports = Array.from({ length: Math.min(rows, totalReports - startIndex) }, (_, i) => ({
      id: `RPT-${String(startIndex + i + 1).padStart(4, '0')}`,
      title: `Report ${startIndex + i + 1}`,
      type: ['Sales', 'Analytics', 'Performance', 'User Activity'][Math.floor(Math.random() * 4)],
      createdAt: new Date(Date.now() - Math.random() * 30 * 24 * 60 * 60 * 1000).toLocaleDateString(),
      status: ['Completed', 'Processing', 'Failed'][Math.floor(Math.random() * 3)],
      size: `${(Math.random() * 10 + 0.5).toFixed(1)} MB`
    }));
  }
  
  function handlePageChange(page) {
    loadReports(page, rowsPerPage, dateRange);
  }
  
  function handleRowCountChange(rows) {
    rowsPerPage = rows;
    loadReports(1, rows, dateRange);
  }
  
  function handleDateRangeChange() {
    loadReports(1, rowsPerPage, dateRange);
  }
  
  // Custom report info generator
  function generateReportInfo(total, pageCount, pageNo, rows) {
    const start = (pageNo - 1) * rows + 1;
    const end = Math.min(pageNo * rows, total);
    return `
      <div style="display: flex; align-items: center; gap: 16px;">
        <span>Reports <b>${start}-${end}</b> of <b>${total}</b></span>
        <span style="color: #666;">•</span>
        <span style="color: #007bff;">Page ${pageNo}/${pageCount}</span>
      </div>
    `;
  }
  
  // Load initial reports
  loadReports(currentPage, rowsPerPage, dateRange);
</script>

<div class="reports-dashboard">
  <div class="dashboard-header">
    <h2>Reports Dashboard</h2>
    <div class="date-filter">
      <label>Time Range:</label>
      <select bind:value={dateRange} on:change={handleDateRangeChange}>
        <option value="today">Today</option>
        <option value="week">This Week</option>
        <option value="month">This Month</option>
        <option value="year">This Year</option>
      </select>
    </div>
  </div>
  
  <div class="reports-table-container">
    <table class="reports-table">
      <thead>
        <tr>
          <th>Report ID</th>
          <th>Title</th>
          <th>Type</th>
          <th>Created</th>
          <th>Status</th>
          <th>Size</th>
          <th>Actions</th>
        </tr>
      </thead>
      <tbody>
        {#each reports as report}
          <tr>
            <td><code>{report.id}</code></td>
            <td>{report.title}</td>
            <td><span class="badge type-{report.type.toLowerCase().replace(' ', '-')}">{report.type}</span></td>
            <td>{report.createdAt}</td>
            <td><span class="status status-{report.status.toLowerCase()}">{report.status}</span></td>
            <td>{report.size}</td>
            <td>
              <button class="action-btn download">Download</button>
              <button class="action-btn delete">Delete</button>
            </td>
          </tr>
        {/each}
      </tbody>
    </table>
  </div>
  
  <PaginationPanel
    pageNo={currentPage}
    pageCount={totalPages}
    total={totalReports}
    rowCount={rowsPerPage}
    rowsSet={[10, 15, 25, 50]}
    rowCountLabel="Reports per page"
    generateInfo={generateReportInfo}
    onPageChange={handlePageChange}
    onRowCountChanged={handleRowCountChange}
    type="plain"
    align="left"
  />
</div>

<style>
  .reports-dashboard {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
  }
  
  .dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
  }
  
  .date-filter {
    display: flex;
    align-items: center;
    gap: 10px;
  }
  
  .date-filter select {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
  }
  
  .reports-table-container {
    overflow-x: auto;
    margin-bottom: 20px;
  }
  
  .reports-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 800px;
  }
  
  .reports-table th,
  .reports-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #ddd;
  }
  
  .reports-table th {
    background-color: #f8f9fa;
    font-weight: 600;
    position: sticky;
    top: 0;
  }
  
  .badge {
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
  }
  
  .badge.type-sales { background: #e3f2fd; color: #1976d2; }
  .badge.type-analytics { background: #f3e5f5; color: #7b1fa2; }
  .badge.type-performance { background: #e8f5e8; color: #388e3c; }
  .badge.type-user-activity { background: #fff3e0; color: #f57c00; }
  
  .status {
    font-weight: 600;
  }
  
  .status.status-completed { color: #28a745; }
  .status.status-processing { color: #ffc107; }
  .status.status-failed { color: #dc3545; }
  
  .action-btn {
    padding: 4px 8px;
    margin: 0 2px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
  }
  
  .action-btn.download {
    background: #007bff;
    color: white;
  }
  
  .action-btn.delete {
    background: #dc3545;
    color: white;
  }
</style>
```

### Log Viewer with Large Dataset

```svelte
<script>
  import PaginationPanel from '@ticatec/uniface-element/PaginationPanel';
  
  let logs = [];
  let currentPage = 1;
  let totalPages = 1;
  let totalLogs = 0;
  let rowsPerPage = 50;
  let logLevel = 'all';
  let searchTerm = '';
  
  const logLevels = ['all', 'error', 'warning', 'info', 'debug'];
  
  async function loadLogs(page = 1, rows = 50, level = 'all', search = '') {
    // Simulate large log dataset
    const levelMultipliers = {
      all: 1,
      error: 0.1,
      warning: 0.15,
      info: 0.6,
      debug: 0.15
    };
    
    const baseLogs = 15000;
    totalLogs = Math.floor(baseLogs * (level === 'all' ? 1 : levelMultipliers[level]));
    
    if (search) {
      totalLogs = Math.floor(totalLogs * 0.2); // Simulate search filtering
    }
    
    totalPages = Math.ceil(totalLogs / rows);
    currentPage = page;
    
    const startIndex = (page - 1) * rows;
    logs = Array.from({ length: Math.min(rows, totalLogs - startIndex) }, (_, i) => {
      const logIndex = startIndex + i + 1;
      const levels = level === 'all' ? ['error', 'warning', 'info', 'debug'] : [level];
      const randomLevel = levels[Math.floor(Math.random() * levels.length)];
      
      return {
        id: logIndex,
        timestamp: new Date(Date.now() - Math.random() * 7 * 24 * 60 * 60 * 1000).toISOString(),
        level: randomLevel,
        message: search 
          ? `Log message ${logIndex} containing "${search}" with additional details`
          : `Log message ${logIndex} - ${randomLevel} level event occurred`,
        source: ['auth', 'api', 'database', 'cache', 'queue'][Math.floor(Math.random() * 5)]
      };
    });
  }
  
  function handlePageChange(page) {
    loadLogs(page, rowsPerPage, logLevel, searchTerm);
  }
  
  function handleRowCountChange(rows) {
    rowsPerPage = rows;
    loadLogs(1, rows, logLevel, searchTerm);
  }
  
  function handleLevelChange() {
    loadLogs(1, rowsPerPage, logLevel, searchTerm);
  }
  
  function handleSearch() {
    loadLogs(1, rowsPerPage, logLevel, searchTerm);
  }
  
  // Custom log info generator
  function generateLogInfo(total, pageCount, pageNo, rows) {
    const start = (pageNo - 1) * rows + 1;
    const end = Math.min(pageNo * rows, total);
    return `
      <div style="font-family: monospace; font-size: 12px;">
        Logs ${start.toLocaleString()}-${end.toLocaleString()} of ${total.toLocaleString()} • Page ${pageNo}/${pageCount}
      </div>
    `;
  }
  
  // Load initial logs
  loadLogs(currentPage, rowsPerPage, logLevel, searchTerm);
</script>

<div class="log-viewer">
  <div class="log-controls">
    <h2>System Logs</h2>
    <div class="filters">
      <div class="filter-group">
        <label>Level:</label>
        <select bind:value={logLevel} on:change={handleLevelChange}>
          {#each logLevels as level}
            <option value={level}>{level.toUpperCase()}</option>
          {/each}
        </select>
      </div>
      <div class="filter-group">
        <label>Search:</label>
        <input 
          type="text" 
          bind:value={searchTerm}
          placeholder="Search logs..."
          on:keydown={(e) => e.key === 'Enter' && handleSearch()}
        />
        <button on:click={handleSearch}>Search</button>
      </div>
    </div>
  </div>
  
  <div class="logs-container">
    {#each logs as log}
      <div class="log-entry level-{log.level}">
        <div class="log-header">
          <span class="timestamp">{new Date(log.timestamp).toLocaleString()}</span>
          <span class="level level-{log.level}">{log.level.toUpperCase()}</span>
          <span class="source">[{log.source}]</span>
        </div>
        <div class="log-message">{log.message}</div>
      </div>
    {/each}
  </div>
  
  <PaginationPanel
    pageNo={currentPage}
    pageCount={totalPages}
    total={totalLogs}
    rowCount={rowsPerPage}
    rowsSet={[25, 50, 100, 200]}
    rowCountLabel="Logs per page"
    generateInfo={generateLogInfo}
    onPageChange={handlePageChange}
    onRowCountChanged={handleRowCountChange}
    type="circle"
  />
</div>

<style>
  .log-viewer {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
  }
  
  .log-controls {
    margin-bottom: 20px;
  }
  
  .log-controls h2 {
    margin: 0 0 16px 0;
  }
  
  .filters {
    display: flex;
    gap: 20px;
    align-items: center;
    flex-wrap: wrap;
  }
  
  .filter-group {
    display: flex;
    align-items: center;
    gap: 8px;
  }
  
  .filter-group select,
  .filter-group input {
    padding: 6px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
  }
  
  .filter-group button {
    padding: 6px 12px;
    background: #007bff;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
  }
  
  .logs-container {
    background: #1e1e1e;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 20px;
    max-height: 600px;
    overflow-y: auto;
    font-family: 'Courier New', monospace;
  }
  
  .log-entry {
    margin-bottom: 12px;
    padding: 8px;
    border-radius: 4px;
    border-left: 4px solid;
  }
  
  .log-entry.level-error {
    background: rgba(220, 53, 69, 0.1);
    border-left-color: #dc3545;
  }
  
  .log-entry.level-warning {
    background: rgba(255, 193, 7, 0.1);
    border-left-color: #ffc107;
  }
  
  .log-entry.level-info {
    background: rgba(0, 123, 255, 0.1);
    border-left-color: #007bff;
  }
  
  .log-entry.level-debug {
    background: rgba(108, 117, 125, 0.1);
    border-left-color: #6c757d;
  }
  
  .log-header {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-bottom: 4px;
    font-size: 12px;
  }
  
  .timestamp {
    color: #adb5bd;
  }
  
  .level {
    font-weight: bold;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 10px;
  }
  
  .level.level-error { background: #dc3545; color: white; }
  .level.level-warning { background: #ffc107; color: black; }
  .level.level-info { background: #007bff; color: white; }
  .level.level-debug { background: #6c757d; color: white; }
  
  .source {
    color: #28a745;
  }
  
  .log-message {
    color: #f8f9fa;
    font-size: 13px;
    line-height: 1.4;
  }
</style>
```

### Mobile-Responsive Panel

```svelte
<script>
  import PaginationPanel from '@ticatec/uniface-element/PaginationPanel';
  import { onMount } from 'svelte';
  
  let currentPage = 1;
  let totalPages = 15;
  let totalItems = 300;
  let rowsPerPage = 20;
  let isMobile = false;
  
  onMount(() => {
    const checkMobile = () => {
      isMobile = window.innerWidth < 768;
    };
    
    checkMobile();
    window.addEventListener('resize', checkMobile);
    
    return () => window.removeEventListener('resize', checkMobile);
  });
  
  function handlePageChange(page) {
    currentPage = page;
  }
  
  function handleRowCountChange(rows) {
    rowsPerPage = rows;
    totalPages = Math.ceil(totalItems / rows);
    currentPage = 1;
  }
  
  // Mobile-friendly info generator
  function generateMobileInfo(total, pageCount, pageNo, rows) {
    if (isMobile) {
      return `<div style="font-size: 12px; text-align: center;">${pageNo}/${pageCount} • ${total} items</div>`;
    }
    return `Showing ${(pageNo - 1) * rows + 1}-${Math.min(pageNo * rows, total)} of ${total} items`;
  }
</script>

<div class="mobile-demo">
  <h2>Mobile-Responsive Pagination</h2>
  <p>Resize your browser to see mobile adaptations</p>
  
  <div class="content-grid">
    {#each Array(rowsPerPage) as _, i}
      <div class="content-item">
        Item {(currentPage - 1) * rowsPerPage + i + 1}
      </div>
    {/each}
  </div>
  
  <PaginationPanel
    pageNo={currentPage}
    pageCount={totalPages}
    total={totalItems}
    rowCount={rowsPerPage}
    rowsSet={isMobile ? [10, 20] : [10, 20, 50]}
    rowCountLabel={isMobile ? "Per page" : "Items per page"}
    generateInfo={generateMobileInfo}
    onPageChange={handlePageChange}
    onRowCountChanged={handleRowCountChange}
    type="round"
    big={!isMobile}
    align={isMobile ? "" : "right"}
  />
</div>

<style>
  .mobile-demo {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
  }
  
  .content-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 16px;
    margin-bottom: 30px;
  }
  
  .content-item {
    padding: 20px;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    text-align: center;
  }
  
  @media (max-width: 767px) {
    .content-grid {
      grid-template-columns: 1fr 1fr;
      gap: 12px;
    }
    
    .content-item {
      padding: 16px;
      font-size: 14px;
    }
  }
</style>
```

## Best Practices

1. **Data Loading**: Implement proper loading states during page transitions
2. **URL Synchronization**: Keep URL parameters in sync with pagination state
3. **Performance**: Use efficient data fetching strategies for large datasets
4. **User Experience**: Provide clear feedback about current state and total items
5. **Mobile Optimization**: Adapt row options and info display for mobile devices
6. **Accessibility**: Ensure all controls are keyboard accessible
7. **Error Handling**: Handle API failures gracefully with retry options

## Styling

The PaginationPanel component combines styling from multiple sub-components:

```css
.uniface-pagination-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 0;
}

.uniface-pagination-panel.left {
  justify-content: flex-start;
}

.uniface-pagination-panel.right {
  justify-content: flex-end;
}

.page-options {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
}

.pagination {
  flex: 0 0 auto;
}

.pagination-info {
  font-size: 14px;
  color: #666;
}

/* Mobile responsive */
@media (max-width: 767px) {
  .uniface-pagination-panel {
    flex-direction: column;
    gap: 12px;
  }
  
  .page-options,
  .pagination-info {
    font-size: 12px;
  }
}
```

## Accessibility

- Full keyboard navigation support
- ARIA labels for all interactive elements
- Screen reader announcements for page changes
- High contrast mode compatibility
- Focus management between controls

## Related Components

- [Pagination](../pagination/README.md) - Core pagination component
- [OptionsSelect](../options-select/README.md) - Row count selector
- [DataTable](../data-table/README.md) - Data tables with pagination
- [Button](../button/README.md) - For custom pagination actions