react

Installation
Summary

React component development guide for building UI with @lobehub/ui, routing, and state management.

  • Use @lobehub/ui components as primary choice, with antd-style for complex styling and inline styles for simple cases; reference node_modules/@lobehub/ui/es/index.mjs for available components
  • Hybrid routing architecture: Next.js App Router for auth pages, React Router DOM for main SPA; always use Link from react-router-dom (not next/link) and useNavigate hook for SPA navigation
  • Layout components include Flexbox, Center, DraggablePanel, and Grid; data display, entry, feedback, and navigation components cover most UI needs
  • Access zustand store data via selectors; use dynamicElement, redirectElement, and ErrorBoundary utilities from @/utils/router for route configuration
SKILL.md

React Component Writing Guide

Styling

Scenario Approach
Most cases createStaticStyles + cssVar.* (zero-runtime, module-level)
Simple one-off Inline style attribute
Truly dynamic (JS color fns like readableColor/chroma) createStyles + tokenlast resort

Component Priority

  1. src/components — project-specific reusable components
  2. @lobehub/ui/base-ui — headless primitives (Select, Modal, DropdownMenu, Popover, Switch, ScrollArea…)
  3. @lobehub/ui — higher-level components (ActionIcon, Markdown, DragPage…)
  4. Custom implementation — last resort; never reach for antd directly

If unsure about available components, search existing code or check node_modules/@lobehub/ui/es/index.mjs.

Related skills

More from lobehub/lobehub

Installs
2.1K
Repository
lobehub/lobehub
GitHub Stars
77.2K
First Seen
Jan 27, 2026