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 从公开仓库中收录这些内容。

举报或申请下架