0.6.7 • Published 10 days ago

@pallassystems/react-bootstrap-table v0.6.7

Weekly downloads
-
License
Apache-2.0
Repository
github
Last release
10 days ago

React Bootstrap Table Libary

Maintainability RatingReliability RatingCoverageApache License, Version 2.0, January 2004PRs Welcome

A library to create a data grid using React, Bootstrap & Bootstrap Icons. This was written as other Bootstrap libraries were written against old versions of React/Bootstrap and everything else was based on the Material UI framework.

Image of the Table

Getting Started

  1. Ensure that you have React 18 or later installed
  2. Install Peer Dependencies
npm install react-bootstrap react-bootstrap-icons
  1. Install react-bootstrap-table
npm install @pallassystems/react-bootstrap-table

Usage

import React, { useMemo, useRef, useState, useEffect } from 'react';
import type { RBTColumnDefs } from '@pallassystems/react-bootstrap-table';
import { RBTable } from '@pallassystems/react-bootstrap-table';

type Person = {
  name: string;
  age: number;
};

const data: Person[] = [
  {
    name: 'John',
    age: 30,
  },
  {
    name: 'Sara',
    age: 25,
  },
];

export default function App() {
  const columns = useMemo<RBTColumnDefs<Person>[]>(
    () => [
      {
        accessorKey: 'name', //simple recommended way to define a column
        header: 'Name',
      },
      {
        accessorFn: (row) => row.age, //alternate way
        id: 'age', //id required if you use accessorFn instead of accessorKey
        header: 'Age',
        Header: () => <i>Age</i>, //optional custom header render
      },
    ],
    [],
  );

  return <RBTable columns={columns} data={data} />;
}

Develop and Contribute

We welcome questions, ideas, issues and code contributions to this project.

Use the issues page to get in touch with the community.

If you would like to make a code contribution please fork the repository and create a GitHub pull request to the main branch.

0.6.7

10 days ago

0.6.6

3 months ago

0.6.3

3 months ago

0.6.5

3 months ago

0.6.2

3 months ago

0.6.1

5 months ago

0.6.0

6 months ago

0.5.1

6 months ago

0.5.0

6 months ago

0.2.1

9 months ago

0.2.0

9 months ago

0.1.0

9 months ago

0.0.3

10 months ago

0.0.2

10 months ago

0.0.1

10 months ago