Introduction

Naming conventions are an eternal struggle since there is no universal rule and somehow every programming languages manages to have different rules for the same things. So here are the naming conventions for Next.js.


Folders

ElementExampleConvention
Normal Folderblog-postlower-hyphen
[slug]ticketIdcamelCase

Files

ElementExampleConvention
ComponentsUserProfile.tsxPascalCase
Non Componentapi-client.tskebab-case

Functions

ElementExampleConvention
ComponentsUserProfilePascalCase
Regular FunctionhandleSubmitcamelCase

Variables

ElementExampleConvention
VariablesuserNamecamelCase
ConstantMAX_RETRY_COUNTSCREAMING_SNAKE_CASE