npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

antd-table-loader

v1.2.0

Published

Antd table with the loader implemented

Downloads

70

Readme

antd-table-loader

import TableWithLoader from "antd-table-loader"
<TableWithLoader
  loader={{ rows: 2, component: "Wait.." }} // Remove me to see the Skeleton effect
  columns={columns} // Your classic antd columns
  dataSource={data} // Your data (Now you don't care if it is null)
/>

When the dataSource is null || undifined the table instead of showing No Data it renders the collumns and the data loading using Skeleton

API

ADDED PROPS

| Name | Type | Default Value | Description | | ------ | -------------------------------------------- | ----------------------------------------------------- | ----------------- | | loader | { rows: Number, component: React.Component } | {rows: 10, component: <Skeleton loading active /> } | The loader values |


Table Props

All Classic props from antd are availble -- AntD Table

| Name | Type | Default Value | Description | | --------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | bordered | boolean | false | Whether to show the table border | | columns | ColumnProps[] | - | Column configuration for the table | | dataSource | Record<string, any>[] | - | Data source for the table | | footer | () => ReactNode | - | Render the table footer | | loading | boolean | { delay?: number } | false | Whether to show a loading indicator | | locale | object | - | Customized text strings for table components, such as filter, emptyText, etc. See Locale for available options | | pagination | TablePaginationConfig | false | - | Pagination configuration for the table | | rowClassName | (record: T, index: number) => string | - | Set the row's className | | rowKey | string \| ((record: T, index: number) => React.Key) | - | Key property for each record in the dataSource | | rowSelection | TableRowSelection<T> | - | Configurations for row selection | | scroll | { x?: boolean \| number \| string \| TableScrollConfig; y?: boolean \| number \| string \| TableScrollConfig; } | - | Configurations for scrollable table | | showHeader | boolean | true | Whether to show the table header | | size | TableSize | 'default' | Size of the table | | summary | (data: T[]) => ReactNode | - | Render the summary row at the bottom of the table | | sticky | boolean | TableSticky | - | Configurations for sticky table headers and columns | | tableLayout | TableLayout | - | Specify the layout mode of the table | | title | () => ReactNode | - | Render the table title | | toolbarRender | (props: { columns: ColumnsType<T>; table: ComponentType<TableProps<T>>; }) => ReactNode | - | Customized toolbar render function | | onChange | (pagination: TablePaginationConfig, filters: Record<string, React.ReactText[] \| null>, sorter: SorterResult<T> \| SorterResult<T>[], extra: TableCurrentDataSource<T>) => void | - | Callback for table change events | | onExpand | (expanded: boolean, record: T) => void | - | Callback when expanding or collapsing a row | | onHeaderRow | (columns: ColumnsType<T>, index: number) => React.HTMLAttributes<HTMLElement> | - | Callback for the row attributes on the table header | | onRow | (record: T, index: number) => React.HTMLAttributes<HTMLElement> | - | Callback for the row attributes on each table row | | onRowClick | (record: T, index: number, event: Event) => void | - | Callback for row click event | | onRowDoubleClick | (record: T, index: number, event: Event) => void | - | Callback for row double click event | | onRowMouseEnter | (record: T, index: number, event: Event) => void | - | Callback for row mouse enter event | | onRowMouseLeave | (record: T, index: number, event: Event) => void | - | Callback for row mouse leave event | | components | { table?: any; header?: { wrapper?: any; row?: any; cell?: any; }; body?: { wrapper?: any; row?: any; cell?: any; }; } | - | Customized components for the table, header, body, etc. | | expandIcon | ((props: ExpandIconProps<T>) => ReactNode) \| ReactNode | - | Customized expand icon for each row | | expandIconColumnIndex | number | - | The index of the column that contains the expand icon | | expandable | ExpandableConfig<T> | - | Configurations for row expandable | | transformColumns | (columns: ColumnsType<T>) => ColumnsType<T> | - | Callback to transform the columns before rendering | | getPopupContainer | (triggerNode: HTMLElement) => HTMLElement | - | Return the mount node for Popover and Dropdown to attach to. | | indentSize | number | 15 | Indent size for each level of nested rows | | expandIconProps | { expandIcon?: (props: ExpandIconProps<T>) => ReactNode; prefixCls?: string; expanded?: boolean; record?: T; onExpand?: (expanded: boolean, record: T) => void; } | - | Props for the expand icon component |