From the course: Master Next.js by Building Scalable Apps with Routing, Databases, and Performance

Unlock this course with a free trial

Join today to access over 25,200 courses taught by industry experts.

Creating add users form

Creating add users form

Now, let's start creating the add users page. So first, I'll create a folder named add in the users folder and create the page JSX inside it. Now let's create a component. So I will say export default function in the division will have an h1. This is the add users page. So the page is ready. Now to access this route on click of the button, we need to give the href in the link component. So here I'll say href slash users slash add. Let's save and check. And on clicking the button, we get the add users page. Let's start with the form creation. First let me define the title. So I will change the text to add user and give it the classes text 3xl font semi bold p2. Let's save and check. All right, now we will create the form. So I'll define a form tag and give it the classes for applying grid system. I will write class name is equal to grid gap x 6 gap y 10 empty 10 grid calls 2 px 2. Now inside the form, I'll have a div for each label input pairs. So for the username, let me define a div…

Contents