Components
Asynchronous Datatable

Asynchronous Datatable

The Asynchronous Datatable component is designed to streamline the process of rendering HTML tables in your web applications. This datatable component offers a rich set of features to enhance the presentation and interactivity of your data.

Basic Usage

The asynchronous datatable has some required props that must be passed to generate the basic datatable. Here is a sample example:

NamePositionAgeStart DateSalary
Humfrey ScainConstruction Foreman4008/10/2023150,000
Jeane SherlandElectrician3812/12/2023140,000
Merrie Van SonConstruction Worker3730/06/2023110,000
Myrtia FitchellProject Manager3509/04/2024110,000
Betty GiannottiConstruction Worker3010/02/2024140,000
Alfy KirimaaEstimator2705/08/202395,000
Arte GledhallConstruction Manager2823/04/202390,000
Ardene BeckensallSupervisor2607/08/2023100,000
Allsun JohnstoneProject Manager2915/07/202380,000
Leigha TattersillEstimator2902/06/202380,000

 

Bordered Table

Async Datatable has border support. It has two seperate props for handling horizontal border and vertical border. If you pass horizontalBorder or verticalBorder then you can see the respective borders accordingly.

NamePositionAgeStart DateSalary
Humfrey ScainConstruction Foreman4008/10/2023150,000
Jeane SherlandElectrician3812/12/2023140,000
Merrie Van SonConstruction Worker3730/06/2023110,000
Myrtia FitchellProject Manager3509/04/2024110,000
Betty GiannottiConstruction Worker3010/02/2024140,000
Alfy KirimaaEstimator2705/08/202395,000
Arte GledhallConstruction Manager2823/04/202390,000
Ardene BeckensallSupervisor2607/08/2023100,000
Allsun JohnstoneProject Manager2915/07/202380,000
Leigha TattersillEstimator2902/06/202380,000

 

Stripped Table

The stripped feature of our Async DataTable component allows you to enhance the visual clarity of your tables by alternating the background color of rows, creating a stripped effect. This can improve readability, especially when dealing with large datasets. You can override the default stripe color by passing a color code through stripeColor prop

NamePositionAgeStart DateSalary
Humfrey ScainConstruction Foreman4008/10/2023150,000
Jeane SherlandElectrician3812/12/2023140,000
Merrie Van SonConstruction Worker3730/06/2023110,000
Myrtia FitchellProject Manager3509/04/2024110,000
Betty GiannottiConstruction Worker3010/02/2024140,000
Alfy KirimaaEstimator2705/08/202395,000
Arte GledhallConstruction Manager2823/04/202390,000
Ardene BeckensallSupervisor2607/08/2023100,000
Allsun JohnstoneProject Manager2915/07/202380,000
Leigha TattersillEstimator2902/06/202380,000

 

Table with Entries Component

The Entries component within the Async Datatable provides users with how many rows are being displayed in the table. It is mandatory to pass the callback function handleNoOfEntriesChange to render this component. There are some optional props that can be passed for customizing this component. For Example: entriesHeader, defaultEntries, entriesArray

NamePositionAgeStart DateSalary
Humfrey ScainConstruction Foreman4008/10/2023150,000
Jeane SherlandElectrician3812/12/2023140,000
Merrie Van SonConstruction Worker3730/06/2023110,000
Myrtia FitchellProject Manager3509/04/2024110,000
Betty GiannottiConstruction Worker3010/02/2024140,000
Alfy KirimaaEstimator2705/08/202395,000
Arte GledhallConstruction Manager2823/04/202390,000
Ardene BeckensallSupervisor2607/08/2023100,000
Allsun JohnstoneProject Manager2915/07/202380,000
Leigha TattersillEstimator2902/06/202380,000
Items per page
10

 

Table with Pagination Component

The Pagination component enhances the usability of the async datatable by providing intuitive navigation controls for browsing through multiple pages of data. It allows users to efficiently navigate large datasets, improving overall user experience and interaction with the datatable.

The Pagination component is seamlessly integrated into the async datatable, automatically rendering when the totalPages, currentPage and handlePageChange props are provided. It requires no additional configuration, offering a hassle-free solution for managing paginated data.

Additionally, if you want to show the info of how many data are showing currently, then you have to pass noOfEntries and totalRecord props.

NamePositionAgeStart DateSalary
Humfrey ScainConstruction Foreman4008/10/2023150,000
Jeane SherlandElectrician3812/12/2023140,000
Merrie Van SonConstruction Worker3730/06/2023110,000
Myrtia FitchellProject Manager3509/04/2024110,000
Betty GiannottiConstruction Worker3010/02/2024140,000
Alfy KirimaaEstimator2705/08/202395,000
Arte GledhallConstruction Manager2823/04/202390,000
Ardene BeckensallSupervisor2607/08/2023100,000
Allsun JohnstoneProject Manager2915/07/202380,000
Leigha TattersillEstimator2902/06/202380,000
-
of 200

 

Overflow Scroll Behavior

The Async Datatable component supports customizable overflow scroll behavior, allowing developers to specify the desired width and height using an object format {x: number, y: number}. This feature sets a width and height that is specified and add a scroller to view overflowed data in the datatable which enhances user experience and navigation within large datasets.

NamePositionAgeStart DateSalary
Humfrey ScainConstruction Foreman4008/10/2023150,000
Jeane SherlandElectrician3812/12/2023140,000
Merrie Van SonConstruction Worker3730/06/2023110,000
Myrtia FitchellProject Manager3509/04/2024110,000
Betty GiannottiConstruction Worker3010/02/2024140,000
Alfy KirimaaEstimator2705/08/202395,000
Arte GledhallConstruction Manager2823/04/202390,000
Ardene BeckensallSupervisor2607/08/2023100,000
Allsun JohnstoneProject Manager2915/07/202380,000
Leigha TattersillEstimator2902/06/202380,000

 

Row Selectable

Async Datatable component supports multiple selection of rows for doing any sort of actions afterwords. You have to pass isSelectableMulti, selectedRows and handleOnSelectChange props to enable this feature. Note that, here, isSelectableMulti is a boolean value, selectedRows expects an array and handleOnSelectChange is the callback function that returns the selectedRows array.

NamePositionAgeStart DateSalary
Humfrey ScainConstruction Foreman4008/10/2023150,000
Jeane SherlandElectrician3812/12/2023140,000
Merrie Van SonConstruction Worker3730/06/2023110,000
Myrtia FitchellProject Manager3509/04/2024110,000
Betty GiannottiConstruction Worker3010/02/2024140,000
Alfy KirimaaEstimator2705/08/202395,000
Arte GledhallConstruction Manager2823/04/202390,000
Ardene BeckensallSupervisor2607/08/2023100,000
Allsun JohnstoneProject Manager2915/07/202380,000
Leigha TattersillEstimator2902/06/202380,000

 

Examples

Example 1

NamePositionOfficeAgeStatusStart DateSalaryAction
Humfrey ScainConstruction ForemanMicheng
40 years
08/10/2023150,000
Jeane SherlandElectricianDonskoye
38 years
12/12/2023140,000
Merrie Van SonConstruction WorkerYanqul
37 years
30/06/2023110,000
Myrtia FitchellProject ManagerMabuttal East
35 years
09/04/2024110,000
Betty GiannottiConstruction WorkerHetang
30 years
10/02/2024140,000
Alfy KirimaaEstimatorEsquipulas
27 years
05/08/202395,000
Arte GledhallConstruction ManagerYabrūd
28 years
23/04/202390,000
Ardene BeckensallSupervisorThị Trấn Thanh Lưu
26 years
07/08/2023100,000
Allsun JohnstoneProject ManagerLiujiage
29 years
15/07/202380,000
Leigha TattersillEstimatorLibao
29 years
02/06/202380,000
Items per page
5
-
of 250

 

API Reference

AsyncDatatable
AttributeTypeDescriptionDefault
columnDefinitions[] Columns of table. -
dataSource[]Array of objects. each object represents a table row. -
horizontalBorderbooleanIf true then adds horizontal border in each row.true
verticalBorderbooleanIf true then adds vertical border in each column.true
strippedbooleanCreates stripped effect in table rows.true
stripeColorstringTo change the default stripe color.#f3f4f6
scrollobjectWhether the table can be scrollable. -
fixedHeaderbooleanSet fixed header. -
headerComponentsReactNodeTo render custom filter header components. -
entriesHeaderstringTo customize default entries lable."Items per page"
defaultEntriesnumberTo select default entry option.5
entriesArray[]To customize no of entries options.[5, 10, 20, 50, 100]
entriesDropdownPositiontopbottomafter clicking the dropdown, items will render in given location.bottom
handleNoOfEntriesChangefunction(value: number)Triggered when a option is selected from entries dropdown. -
totalPagesnumberto pass total page number. -
currentPagenumberto pass the current page value in pagination component. -
noOfEntriesnumberto define how many entries to show in per page.5
totalRecordnumberto defines total number of data in a table. -
entriesShowingSpaceTextstringto customize the string between how many data are showing in the table and total record."of"
handlePageChangefunction(value: number)Triggered when a option is selected from pagination page items. -
dynamicPreviousTextstringFor customizing previous btn label of pagination.Previous
dynamicNextTextstringFor customizing next btn label of pagination.Next
previousIconReactNodeFor customizing previous btn icon.
nextIconReactNodeFor customizing next btn icon.
rtlbooleanFor rtl support in table.false
isLoadingbooleanFor showing a spinner when data is loading.false
customLoadingComponentReactNodeFor customizing loader when data is fetching.
customEmptyDataComponentReactNodeFor customizing design when there is no data in table.
handleOnSortfunction(headerName: string, sortOrder: "asc" | "desc")Callback function for sorting in server side. Also need to pass isSortable props in column definition. -
isSelectableMultibooleanRenders checkbox for selection before every row.false
handleOnSelectChangefunction(selectedRows: [])Callback function that passes selected rows when select checkbox is clicked. -
selectedRows[]To pass selected rows that are being passed by the callback function -
stylesobjectFor customizing table styling.
columnDefinitions
AttributeTypeDescriptionDefault
titlestringTitle of this column. -
dataIndexstringKey name of the data record. -
alignstartcenterendTo specify which way that column is aligned.start
widthstringWidth of this column. Takes both px or percentage value. -
isSortablebooleanFor rendering the sortable icon. -
renderfunction(value: unknown, record: unknown)Renderer of the table cell. The return value should be a ReactNode. -
styles
AttributeTypeDescriptionDefault
datatableFooterWrapperClassNamestringFor customizing styles of datatable footer that contains entries and pagination. -
paginationWrapperClassNamestringFor customizing styles of pagination wrapper. -
paginationNoOfEntriesWrapperClassNamestringFor customizing styles of pagination no of entries wrapper. -
paginationPrevBtnClassNamestringFor customizing styles of pagination previous wrapper. -
paginationNextBtnClassNamestringFor customizing styles of pagination next wrapper. -
paginationButtonClassNamestringFor customizing styles of pagination all number buttons. -
paginationButtonSelectedClassNamestringFor customizing styles of pagination selected button. -
headerWrapperClassNamestringFor customizing styles of datatable table header wrapper. -
headItemClassNamestringFor customizing styles of datatable table head item. -
headItemLabelClassstringFor customizing styles of datatable table head label. -
tableBodyWrapperClassNamestringFor customizing styles of datatable table body wrapper. -
rowWrapperClassNamestringFor customizing styles of datatable row wrapper. -
rowItemClassNamestringFor customizing styles of datatable single row. -
rowItemLabelClassNamestringFor customizing styles of datatable table body row label. -
entriesWrapperClassNamestringFor customizing styles of entries wrapper. -
entriesHeaderClassNamestringFor customizing styles of entries header. -
selectEntriesWrapperClassNamestringFor customizing styles of entries select dropdown input. -
selectEntryItemClassNamestringFor customizing styles of entries dropdown each item. -