TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Show HN: Grid.js – Advanced table library that works everywhere

390 pointsby afshinmehalmost 5 years ago

36 comments

afshinmehalmost 5 years ago
Hello folks :wave:<p>I’m Afshin, the creator of Grid.js.<p>Grid.js is an open-source table library written in TypeScript and published under MIT license.<p>My goal is to develop a framework agnostic table library that:<p>- Works everywhere. You don’t need a specific framework to use Grid.js<p>- Lightweight and easy to use<p>- Fully documented and tested<p>- Developer friendly. Grid.js is written in TypeScript! Supports all modern web browsers<p>Please take a look at the examples (<a href="https:&#x2F;&#x2F;gridjs.io&#x2F;docs&#x2F;examples&#x2F;hello-world" rel="nofollow">https:&#x2F;&#x2F;gridjs.io&#x2F;docs&#x2F;examples&#x2F;hello-world</a>) section and let us know if you have any suggestions.<p>Although Grid.js is currently designed to work with web-browsers, I’m actively thinking and working on adding other integrations like React Native (see <a href="https:&#x2F;&#x2F;gridjs.io&#x2F;docs&#x2F;philosophy" rel="nofollow">https:&#x2F;&#x2F;gridjs.io&#x2F;docs&#x2F;philosophy</a>)<p>Please let me know if you have any suggestions or comments. Happy hacking! :computer:
评论 #23420901 未加载
评论 #23420966 未加载
评论 #23426159 未加载
评论 #23427597 未加载
评论 #23420837 未加载
评论 #23425314 未加载
评论 #23422614 未加载
评论 #23433380 未加载
评论 #23423644 未加载
评论 #23425014 未加载
评论 #23422143 未加载
评论 #23421660 未加载
Bishonen88almost 5 years ago
Good effort! I&#x27;m not sure how &#x27;advanced&#x27; it is though. I&#x27;d even go as far as call it &#x27;simple&#x27;?<p>E.g. the following features would be required to make it advanced (list not complete):<p>- Export data (csv)<p>- Align columns based on their content<p>- Tree data (parent&#x2F;child rows)<p>- Total rows<p>- Formatting applied based on data type (currency, numerical etc.)<p>- Reordering columns<p>- Resizing columns<p>- Hiding columns<p>- Optional filter field for every column<p>- Conditional formatting<p>- Tripple Sorting &amp; Multiple sorting (sort by more than 1 column at a time)<p>- ... more<p>In the react world, I found this to be a good foundation for an &#x27;advanced&#x27; table. Since it&#x27;s rather inconsistently developed, I ended up forking it for myself and working on my own copy, removing unneeded elements and enhancing with everything else I do need.<p><a href="https:&#x2F;&#x2F;material-table.com&#x2F;" rel="nofollow">https:&#x2F;&#x2F;material-table.com&#x2F;</a>
评论 #23422438 未加载
评论 #23426424 未加载
bubbabalmost 5 years ago
How accessible is Grid.js? The main differentiator between table libraries for me these days is accessibility. Many libraries and frameworks out there do it poorly. The better ones are often tied to company-specific frameworks.<p>From playing around a bit, I&#x27;ve at least noticed that sortable headers have no focus indicator, the &quot;sort column ascending&quot; text gets included in the column&#x27;s accessible name, and un-sortable column headers are read as clickable by screen readers.<p>I would LOVE a framework-agnostic table library that&#x27;s both lightweight and fully accessible. If there&#x27;s a chance for Grid.js to take this in its philosophy, I would be all in!
评论 #23422621 未加载
评论 #23421122 未加载
评论 #23421042 未加载
danseagravealmost 5 years ago
Has anyone tried Tabulator[1]?<p>[1] <a href="http:&#x2F;&#x2F;www.tabulator.info&#x2F;" rel="nofollow">http:&#x2F;&#x2F;www.tabulator.info&#x2F;</a>
评论 #23422618 未加载
评论 #23424226 未加载
评论 #23422650 未加载
评论 #23422184 未加载
Eduardalmost 5 years ago
I&#x27;d say the claim &quot;works everywhere&quot; does not consider small screens. I had a look at the examples with Android Chrome in portrait viewport, and cell content gets either cut off with ellipses on overflow, or breaks long words such as email addresses unintelligibly over several lines.<p>In my opinion, scrollable-by-touch tables such as Bootstrap &#x27;s &quot;responsive tables&quot; fix these issues. Add &quot;scroll for more&quot; shadows for even better UX.
rootcagealmost 5 years ago
Out of curiosity how is this better than current Grid&#x2F;Table implementations?
评论 #23420951 未加载
boromialmost 5 years ago
A similar product is <a href="https:&#x2F;&#x2F;datatables.net&#x2F;" rel="nofollow">https:&#x2F;&#x2F;datatables.net&#x2F;</a>
评论 #23422058 未加载
评论 #23422643 未加载
triceratopsalmost 5 years ago
Does anyone know why HTML tables can&#x27;t natively support a lot of common table functionality? Lazy rendering, fixed column headers, sorting and so on? Are there any proposals to add all this natively?
评论 #23426468 未加载
rkagereralmost 5 years ago
This looks really cool although I find it disheartening that we need to resort to JavaScript simply to construct a decent table.
评论 #23426126 未加载
hendryalmost 5 years ago
<a href="https:&#x2F;&#x2F;codemadness.org&#x2F;datatable-example.html" rel="nofollow">https:&#x2F;&#x2F;codemadness.org&#x2F;datatable-example.html</a> is the lightest version of sortable table in JS i&#x27;ve seen.<p><a href="https:&#x2F;&#x2F;git.codemadness.org&#x2F;jscancer&#x2F;files.html" rel="nofollow">https:&#x2F;&#x2F;git.codemadness.org&#x2F;jscancer&#x2F;files.html</a> for more goodness
sliptypealmost 5 years ago
This looks nice but much less configurable than ag-grid.<p>I&#x27;ve worked on projects that had very intense excel-level requirements for their data grids and ag-grid was a dream.
评论 #23421534 未加载
gugglealmost 5 years ago
Good, I like framework agnostic components. I&#x27;ve been playing with two other libraries recently: Dropzone js and Sortable js. Grid js looks useful too.
silviogutierrezalmost 5 years ago
Looks great! Any plans to support SSR in say, the React use case? useEffect won&#x27;t run on the server and obviously you don&#x27;t have the DOM.<p>I&#x27;d love to use this for the table to come rendered from the server then hydrate on the frontend and enable AJAX pagination, etc.<p>Completely understand if you can&#x27;t, after all, you&#x27;d likely need to more tightly integrate with ReactDOMServer.
评论 #23425950 未加载
byteshockalmost 5 years ago
Looks awesome. We just tested vue-tables-2 yesterday but the lack of customization is making it hard to implement. This looks very promising, I’ll be taking a look again tomorrow!<p>Do you plan on releasing special themes or options for css frameworks like bootstrap 4? I had a quick look on my phone so I apologize if this is already available.
mason55almost 5 years ago
One of the issues we find is that as the number of rows&#x2F;columns in a table grows, the performance of native browser tables just craters and you have to fallback to your own rendering engine using &lt;canvas&gt; elements.<p>Have you pushed the rendering performance at all to see how far you can get without scrolling getting painful or seeing tearing artifacts?
评论 #23422282 未加载
评论 #23426136 未加载
feddalmost 5 years ago
Hey, nice grid. Please consider multiple column sort &#x2F; grouping. It will suddenly make it like analytics tool... And if add some statistical functions... Maybe too much for client side, but who knows
ggmartinsalmost 5 years ago
I like <a href="https:&#x2F;&#x2F;www.npmjs.com&#x2F;package&#x2F;react-data-table-component" rel="nofollow">https:&#x2F;&#x2F;www.npmjs.com&#x2F;package&#x2F;react-data-table-component</a> but this one looks cool too. Maybe a dense mode?
OJFordalmost 5 years ago
FYI on my small mobile screen (iPhone SE) the demo:<p>- ellipsis (good there is one) breaks between second and third dot. I think the easiest fix for that is to use an actual ellipsis character.<p>- break between page &#x27;3&#x27; and &#x27;next&#x27;
yingw787almost 5 years ago
I am so glad I put off making the frontend for my project. It&#x27;s literally all tables, and I didn&#x27;t like how DataTables functioned. So glad you made this and looking forward to trying it out!!
rafaelturkalmost 5 years ago
Congrats! Curious why you haven&#x27;t considered <a href="https:&#x2F;&#x2F;react-table.js.org&#x2F;" rel="nofollow">https:&#x2F;&#x2F;react-table.js.org&#x2F;</a>
guruparan18almost 5 years ago
I am trying to use linking in one of the columns. Looks like using links breaks the table. Any idea if linking column data is supported out of box?
ng12almost 5 years ago
Do the cell values have to be primitives? Embedding pure JS inside a React app is easy but using React inside pure JS is usually where the trouble is.
评论 #23421135 未加载
codegladiatoralmost 5 years ago
What&#x27;s the &quot;Advanced&quot; part in this ? Vue&#x2F;quasar tables already provide extensive functionality and I am sure there are react and angular alternatives.<p>I don&#x27;t think there is a need for a library to work across vue&#x2F;react&#x2F;angular at the same time because no single person is going to use those in a single project.<p>I appreciate the project since I am frequently looking for js grid implementations but what the differentiator here ? Is it performance or styling or flexibility or just variety of frameworks ?
评论 #23421666 未加载
评论 #23421636 未加载
babaganoosh89almost 5 years ago
I&#x27;d suggest doing the up&#x2F;down arrows in css instead of images, the images look a bit blurry on retina screens
评论 #23421479 未加载
wnevetsalmost 5 years ago
On a related note, I glad to see unpkg.com offically supported. Being able to avoid npm install is just nice sometimes.
评论 #23421092 未加载
JSavageOnealmost 5 years ago
How does this compare to competitors like Ag-Grid?<p>One simple feature I see lacking in the ability is the ability to resize columns
LukaszWiktoralmost 5 years ago
Good job! Looks great.<p>What about performance? Have you tested how many rows can Gird.js handle without a noticable lag?
评论 #23421086 未加载
kangaroozachalmost 5 years ago
Anyone have thoughts on how to support the following in ReactJS<p>-Sortable columns<p>-Multi-select filters in columns<p>-expandable rows
评论 #23426763 未加载
huhtenbergalmost 5 years ago
This doesn&#x27;t render well (it&#x27;s a malformed input, but still) -<p><pre><code> const grid = new Grid({ columns: [&#x27;A&#x27;, &#x27;B&#x27;, &#x27;C&#x27;], data: [ [&#x27;1&#x27;, &#x27;2&#x27;, null, &#x27;(353) 01 222 3333&#x27;] ] });</code></pre>
moralestapiaalmost 5 years ago
Does anyone know of something like this but with editable cells?
评论 #23425845 未加载
评论 #23423939 未加载
Phrodo_00almost 5 years ago
Tried to run in my atari 800XL - didn&#x27;t work :P
seastonATccsalmost 5 years ago
What benefits does it have over mat-table?
colesantiagoalmost 5 years ago
I disabled JavaScript and it doesn&#x27;t load the table.
评论 #23421718 未加载
评论 #23421760 未加载
评论 #23421603 未加载
docurualmost 5 years ago
Are we just buy a domain for a library now?
beprogrammedalmost 5 years ago
I like to turn JavaScript off for these sites
Sembiancealmost 5 years ago
I thought this was about CSS Grid, but nope, nothing at all to do with that.
评论 #23422833 未加载