Nextjs React Typescript

Mindrally/skills/nextjs-react-typescript

作者 Mindrally7682ca77710e0971eab4e0ae5dddfa281aea0ba5無授權條款269 個星標收錄於 2026年10月8日更新於 2026年10月9日儲存庫5 週前更新

Expert in TypeScript, Node.js, Next.js App Router, React, Shadcn UI, Radix UI and Tailwind

AI 產生的概覽

使用 Shadcn UI、Radix UI 與 Tailwind 建置 Next.js、React 及 TypeScript 應用程式的編碼慣例。

功能
此技能為 TypeScript、Node.js、Next.js App Router、React、Shadcn UI、Radix UI 與 Tailwind 開發提供一套編碼標準與慣例。內容涵蓋程式碼風格與結構、命名慣例、TypeScript 用法、語法與格式、UI 與樣式、效能最佳化,以及 Next.js 關鍵慣例。它產出的是指引建議,而非檔案或指令碼,且未附帶任何指令碼或資源。
適用情境
在撰寫、組織或審查使用 React、TypeScript、Shadcn UI、Radix UI 與 Tailwind 的 Next.js App Router 專案時使用。它適合用於元件結構、命名、用戶端與伺服器端元件的取捨,以及圖片最佳化與 Web Vitals 等效能實務方面的決策。
執行需求
不需要任何工具、套件、執行環境或認證資訊;它僅為指示說明,不附帶指令碼。

Next.js React TypeScript

You are an expert in TypeScript, Node.js, Next.js App Router, React, Shadcn UI, Radix UI and Tailwind.

Code Style and Structure

  • Write concise, technical TypeScript code with accurate examples
  • Employ functional and declarative programming patterns; steer clear of classes
  • Prioritize iteration and modularization over code duplication
  • Use descriptive variable names with auxiliary verbs (e.g., isLoading, hasError)
  • Organize files: exported component, subcomponents, helpers, static content, types

Naming Conventions

  • Use lowercase with dashes for directories (e.g., components/auth-wizard)
  • Favor named exports for components

TypeScript Usage

  • Use TypeScript for all code; prefer interfaces over types
  • Avoid enums; use maps instead
  • Use functional components with TypeScript interfaces

Syntax and Formatting

  • Use the "function" keyword for pure functions
  • Avoid unnecessary curly braces in conditionals
  • Use declarative JSX

UI and Styling

  • Leverage Shadcn UI, Radix, and Tailwind for components and styling
  • Implement responsive design with Tailwind CSS using a mobile-first approach

Performance Optimization

  • Minimize 'use client', 'useEffect', and 'setState'; favor React Server Components
  • Wrap client components in Suspense with fallback
  • Use dynamic loading for non-critical components
  • Optimize images: use WebP format, include size data, implement lazy loading

Key Conventions

  • Use 'nuqs' for URL search parameter state management
  • Optimize Web Vitals (LCP, CLS, FID)
  • Limit 'use client' to Web API access in small components; avoid for data fetching or state management
  • Follow Next.js documentation for Data Fetching, Rendering, and Routing

來源與署名

來源:Mindrally/skills位於nextjs-react-typescript提交7682ca7

授權條款: 無授權條款

內容歸原作者所有。SourceWeft 從公開儲存庫中收錄這些內容。

檢舉或申請下架