This video is available to students only

Setting Up and Configuring Tables in shadcn/ui

Building a powerful table to display a list of events that users have registered for.

In this lesson, you'll build a table to display a list of events that users have registered for.

Later on in this module, you'll also build a table to display the user created events.

The API offers a /rsvp route that returns a list of events the user has registered for. You'll use this route to fetch the data for the table.

table

Setting Up and Configuring Your Events Table#

Installing shadcn/ui DataTable requires two commands:

  • Adding the shadcn/ui Table component through the shadcn/ui CLI:

  • Installing @tanstack/react-table from npm:

Creating and Structuring the Events Table#

You'll now create your first table. It'll show users the events they have registered for through the home page.

The first step will be to create a new page at /events.

Create a new file at app/events/page.tsx and add the following code:

Create a new registered-table.tsx file in the app/events directory.

This file will contain the table that displays the events that the user has registered for.

This lesson preview is part of the Sleek Next.JS Applications with shadcn/ui course and can be unlocked immediately with a \newline Pro subscription or a single-time purchase. Already have access to this course? Log in here.

Unlock This Course

Get unlimited access to Sleek Next.JS Applications with shadcn/ui, plus 70+ \newline books, guides and courses with the \newline Pro subscription.

Thumbnail for the \newline course Sleek Next.JS Applications with shadcn/ui