All Downloads are FREE. Search and download functionalities are using the official Maven repository.

package.src.components.Pagination.ToggleTemplate.tsx Maven / Gradle / Ivy

Go to download

This library provides a set of common React components for use with the PatternFly reference implementation.

The newest version!
import * as React from 'react';

/** Allows more customization of the pagination dropdown toggle. The following properties
 * should be passed into the pagination component's toggleTemplate property.
 */

export interface PaginationToggleTemplateProps {
  /** The first index of the items being paginated */
  firstIndex?: number;
  /** The last index of the items being paginated */
  lastIndex?: number;
  /** The total number of items being paginated */
  itemCount?: number;
  /** The type or title of the items being paginated */
  itemsTitle?: string;
  /** The word that joins the index and itemCount/itemsTitle */
  ofWord?: React.ReactNode;
}

export const ToggleTemplate: React.FunctionComponent = ({
  firstIndex = 0,
  lastIndex = 0,
  itemCount = 0,
  itemsTitle = 'items',
  ofWord = 'of'
}: PaginationToggleTemplateProps) => (
  
    
      {firstIndex} - {lastIndex}
    {' '}
    {ofWord} {itemCount} {itemsTitle}
  
);
ToggleTemplate.displayName = 'ToggleTemplate';




© 2015 - 2024 Weber Informatics LLC | Privacy Policy