@ranimontagna/agent-toolkit 0.3.6 → 0.3.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +2 -0
- package/README.md +1 -1
- package/package.json +1 -1
- package/skills/backend/fastify-best-practices/NOTICE.md +1 -1
- package/skills/backend/fastify-best-practices/rules/authentication.md +13 -0
- package/skills/backend/fastify-best-practices/rules/configuration.md +9 -0
- package/skills/backend/fastify-best-practices/rules/content-type.md +16 -0
- package/skills/backend/fastify-best-practices/rules/cors-security.md +18 -0
- package/skills/backend/fastify-best-practices/rules/database.md +12 -0
- package/skills/backend/fastify-best-practices/rules/decorators.md +14 -0
- package/skills/backend/fastify-best-practices/rules/deployment.md +16 -0
- package/skills/backend/fastify-best-practices/rules/error-handling.md +16 -0
- package/skills/backend/fastify-best-practices/rules/hooks.md +20 -0
- package/skills/backend/fastify-best-practices/rules/http-proxy.md +11 -0
- package/skills/backend/fastify-best-practices/rules/logging.md +18 -0
- package/skills/backend/fastify-best-practices/rules/performance.md +20 -0
- package/skills/backend/fastify-best-practices/rules/plugins.md +14 -0
- package/skills/backend/fastify-best-practices/rules/routes.md +18 -0
- package/skills/backend/fastify-best-practices/rules/schemas.md +20 -0
- package/skills/backend/fastify-best-practices/rules/serialization.md +19 -0
- package/skills/backend/fastify-best-practices/rules/testing.md +17 -0
- package/skills/backend/fastify-best-practices/rules/typescript.md +15 -0
- package/skills/backend/fastify-best-practices/rules/websockets.md +15 -0
- package/skills/backend/go/golang-patterns/NOTICE.md +1 -1
- package/skills/backend/go/golang-patterns/SKILL.md +2 -1
- package/skills/devops/docker-patterns/NOTICE.md +1 -1
- package/skills/devops/docker-patterns/SKILL.md +3 -3
- package/skills/frontend/design/revenue-centric-design/NOTICE.md +1 -1
- package/skills/frontend/design/revenue-centric-design/SKILL.md +6 -4
- package/skills/frontend/design/revenue-centric-design/assets/1985681720104903142__1.jpg +0 -0
- package/skills/frontend/design/revenue-centric-design/assets/1999584679247134761__1.jpg +0 -0
- package/skills/frontend/design/revenue-centric-design/assets/2000930776636940333__1.jpg +0 -0
- package/skills/frontend/design/revenue-centric-design/assets/2018693884449009956__3.jpg +0 -0
- package/skills/frontend/design/revenue-centric-design/assets/2081714430811730162__1.jpg +0 -0
- package/skills/frontend/design/revenue-centric-design/assets/2092692547244007852__q__1.jpg +0 -0
- package/skills/frontend/design/revenue-centric-design/assets/2092692547244007852__q__2.jpg +0 -0
- package/skills/frontend/design/revenue-centric-design/assets/2092692547244007852__q__3.jpg +0 -0
- package/skills/frontend/design/revenue-centric-design/references/checkout-and-forms.md +39 -0
- package/skills/frontend/design/revenue-centric-design/references/churn-and-retention.md +25 -0
- package/skills/frontend/design/revenue-centric-design/references/conversion-and-landing-pages.md +52 -1
- package/skills/frontend/design/revenue-centric-design/references/dashboards-and-data-viz.md +23 -0
- package/skills/frontend/design/revenue-centric-design/references/metrics-and-experimentation.md +13 -0
- package/skills/frontend/design/revenue-centric-design/references/onboarding-and-activation.md +7 -1
- package/skills/frontend/design/revenue-centric-design/references/pricing-and-monetization.md +35 -8
- package/skills/frontend/design/revenue-centric-design/references/product-strategy-and-features.md +37 -0
- package/skills/frontend/design/revenue-centric-design/references/revenue-centric-design.md +2 -2
- package/skills/frontend/design/ui-ux-pro-max/NOTICE.md +6 -4
- package/skills/frontend/design/ui-ux-pro-max/SKILL.md +103 -573
- package/skills/frontend/design/ui-ux-pro-max/data/app-interface.csv +29 -27
- package/skills/frontend/design/ui-ux-pro-max/data/catalog-summary.json +78 -0
- package/skills/frontend/design/ui-ux-pro-max/data/charts.csv +26 -26
- package/skills/frontend/design/ui-ux-pro-max/data/colors.csv +191 -160
- package/skills/frontend/design/ui-ux-pro-max/data/data-provenance.json +1348 -0
- package/skills/frontend/design/ui-ux-pro-max/data/google-font-licenses.json +20185 -0
- package/skills/frontend/design/ui-ux-pro-max/data/google-fonts.csv +1934 -1923
- package/skills/frontend/design/ui-ux-pro-max/data/icons.csv +106 -106
- package/skills/frontend/design/ui-ux-pro-max/data/landing.csv +35 -35
- package/skills/frontend/design/ui-ux-pro-max/data/motion.csv +18 -0
- package/skills/frontend/design/ui-ux-pro-max/data/phosphor-icons-upstream.json +32582 -0
- package/skills/frontend/design/ui-ux-pro-max/data/products.csv +192 -161
- package/skills/frontend/design/ui-ux-pro-max/data/react-performance.csv +37 -37
- package/skills/frontend/design/ui-ux-pro-max/data/stacks/angular.csv +51 -51
- package/skills/frontend/design/ui-ux-pro-max/data/stacks/astro.csv +54 -54
- package/skills/frontend/design/ui-ux-pro-max/data/stacks/avalonia.csv +57 -0
- package/skills/frontend/design/ui-ux-pro-max/data/stacks/flutter.csv +53 -53
- package/skills/frontend/design/ui-ux-pro-max/data/stacks/html-tailwind.csv +60 -56
- package/skills/frontend/design/ui-ux-pro-max/data/stacks/javafx.csv +76 -0
- package/skills/frontend/design/ui-ux-pro-max/data/stacks/jetpack-compose.csv +53 -53
- package/skills/frontend/design/ui-ux-pro-max/data/stacks/laravel.csv +51 -51
- package/skills/frontend/design/ui-ux-pro-max/data/stacks/nextjs.csv +62 -53
- package/skills/frontend/design/ui-ux-pro-max/data/stacks/nuxt-ui.csv +77 -51
- package/skills/frontend/design/ui-ux-pro-max/data/stacks/nuxtjs.csv +68 -59
- package/skills/frontend/design/ui-ux-pro-max/data/stacks/react-native.csv +52 -52
- package/skills/frontend/design/ui-ux-pro-max/data/stacks/react.csv +67 -54
- package/skills/frontend/design/ui-ux-pro-max/data/stacks/shadcn.csv +69 -61
- package/skills/frontend/design/ui-ux-pro-max/data/stacks/svelte.csv +56 -54
- package/skills/frontend/design/ui-ux-pro-max/data/stacks/swiftui.csv +51 -51
- package/skills/frontend/design/ui-ux-pro-max/data/stacks/threejs.csv +54 -54
- package/skills/frontend/design/ui-ux-pro-max/data/stacks/uno.csv +60 -0
- package/skills/frontend/design/ui-ux-pro-max/data/stacks/uwp.csv +56 -0
- package/skills/frontend/design/ui-ux-pro-max/data/stacks/vue.csv +50 -50
- package/skills/frontend/design/ui-ux-pro-max/data/stacks/winui.csv +60 -0
- package/skills/frontend/design/ui-ux-pro-max/data/stacks/wpf.csv +57 -0
- package/skills/frontend/design/ui-ux-pro-max/data/styles.csv +89 -85
- package/skills/frontend/design/ui-ux-pro-max/data/typography.csv +74 -73
- package/skills/frontend/design/ui-ux-pro-max/data/ui-reasoning.csv +193 -162
- package/skills/frontend/design/ui-ux-pro-max/data/ux-guidelines.csv +30 -10
- package/skills/frontend/design/ui-ux-pro-max/references/pro-rules.md +117 -0
- package/skills/frontend/design/ui-ux-pro-max/references/quick-reference.md +256 -0
- package/skills/frontend/design/ui-ux-pro-max/scripts/core.py +800 -69
- package/skills/frontend/design/ui-ux-pro-max/scripts/design_system.py +700 -180
- package/skills/frontend/design/ui-ux-pro-max/scripts/reasoning_contract.py +123 -0
- package/skills/frontend/design/ui-ux-pro-max/scripts/search.py +105 -42
- package/skills/frontend/design/ui-ux-pro-max/scripts/validate_data.py +1095 -0
- package/skills/frontend/react-native/react-native-unistyles-v3/NOTICE.md +1 -1
- package/skills/frontend/react-native/react-native-unistyles-v3/SKILL.md +33 -24
- package/skills/frontend/react-native/react-native-unistyles-v3/references/api-reference.md +135 -78
- package/skills/frontend/react-native/react-native-unistyles-v3/references/common-issues.md +48 -31
- package/skills/frontend/react-native/react-native-unistyles-v3/references/setup-guide.md +76 -34
- package/skills/frontend/react-native/react-native-unistyles-v3/references/styling-patterns.md +145 -52
- package/skills/frontend/react-native/react-native-unistyles-v3/references/third-party-integration.md +76 -27
- package/skills/media/brag-slim/NOTICE.md +3 -3
- package/skills/media/brag-slim/SKILL.md +4 -0
- package/skills/frontend/design/revenue-centric-design/assets/2018693884449009956__1.jpg +0 -0
- package/skills/frontend/design/ui-ux-pro-max/data/_sync_all.py +0 -414
- package/skills/frontend/design/ui-ux-pro-max/data/design.csv +0 -1776
- package/skills/frontend/design/ui-ux-pro-max/data/draft.csv +0 -1779
|
@@ -1,52 +1,52 @@
|
|
|
1
|
-
No,Category,Guideline,Description,Do,Don't,Code Good,Code Bad,Severity,Docs URL
|
|
2
|
-
1,Components,Use functional components,Hooks-based components are standard,Functional components with hooks,Class components,const App = () => { },class App extends Component,Medium,https://reactnative.dev/docs/intro-react
|
|
3
|
-
2,Components,Keep components small,Single responsibility principle,Split into smaller components,Large monolithic components,<Header /><Content /><Footer />,500+ line component,Medium,
|
|
4
|
-
3,Components,Use TypeScript,Type safety for props and state,TypeScript for new projects,JavaScript without types,const Button: FC<Props> = () => { },const Button = (props) => { },Medium,
|
|
5
|
-
4,Components,Colocate component files,Keep related files together,Component folder with styles,Flat structure,components/Button/index.tsx styles.ts,components/Button.tsx styles/button.ts,Low,
|
|
6
|
-
5,Styling,Use StyleSheet.create,Optimized style objects,StyleSheet for all styles,Inline style objects,StyleSheet.create({ container: {} }),style={{ margin: 10 }},High,https://reactnative.dev/docs/stylesheet
|
|
7
|
-
6,Styling,Avoid inline styles,Prevent object recreation,Styles in StyleSheet,Inline style objects in render,style={styles.container},"style={{ margin: 10, padding: 5 }}",Medium,
|
|
8
|
-
7,Styling,Use flexbox for layout,React Native uses flexbox,flexDirection alignItems justifyContent,Absolute positioning everywhere,flexDirection: 'row',position: 'absolute' everywhere,Medium,https://reactnative.dev/docs/flexbox
|
|
9
|
-
8,Styling,Handle platform differences,Platform-specific styles,Platform.select or .ios/.android files,Same styles for both platforms,"Platform.select({ ios: {}, android: {} })",Hardcoded iOS values,Medium,https://reactnative.dev/docs/platform-specific-code
|
|
10
|
-
9,Styling,Use responsive dimensions,Scale for different screens,Dimensions or useWindowDimensions,Fixed pixel values,useWindowDimensions(),width: 375,Medium,
|
|
11
|
-
10,Navigation,Use React Navigation,Standard navigation library,React Navigation for routing,Manual navigation management,createStackNavigator(),Custom navigation state,Medium,https://reactnavigation.org
|
|
12
|
-
11,Navigation,Type navigation params,Type-safe navigation,Typed navigation props,Untyped navigation,"navigation.navigate<RootStackParamList>('Home', { id })","navigation.navigate('Home', { id })",Medium,
|
|
13
|
-
12,Navigation,Use deep linking,Support URL-based navigation,Configure linking prop,No deep link support,linking: { prefixes: [] },No linking configuration,Medium,https://reactnavigation.org/docs/deep-linking
|
|
14
|
-
13,Navigation,Handle back button,Android back button handling,useFocusEffect with BackHandler,Ignore back button,BackHandler.addEventListener,No back handler,High,
|
|
15
|
-
14,State,Use useState for local state,Simple component state,useState for UI state,Class component state,"const [count, setCount] = useState(0)",this.state = { count: 0 },Medium,
|
|
16
|
-
15,State,Use useReducer for complex state,Complex state logic,useReducer for related state,Multiple useState for related values,useReducer(reducer initialState),5+ useState calls,Medium,
|
|
17
|
-
16,State,Use context sparingly,Context for global state,Context for theme auth locale,Context for frequently changing data,ThemeContext for app theme,Context for list item data,Medium,
|
|
18
|
-
17,State,Consider Zustand or Redux,External state management,Zustand for simple Redux for complex,useState for global state,create((set) => ({ })),Prop drilling global state,Medium,
|
|
19
|
-
18,Lists,Use FlatList for long lists,Virtualized list rendering,FlatList for 50+ items,ScrollView with map,<FlatList data={items} />,<ScrollView>{items.map()}</ScrollView>,High,https://reactnative.dev/docs/flatlist
|
|
20
|
-
19,Lists,Provide keyExtractor,Unique keys for list items,keyExtractor with stable ID,Index as key,keyExtractor={(item) => item.id},"keyExtractor={(_, index) => index}",High,
|
|
21
|
-
20,Lists,Optimize renderItem,Memoize list item components,React.memo for list items,Inline render function,renderItem={({ item }) => <MemoizedItem item={item} />},renderItem={({ item }) => <View>...</View>},High,
|
|
22
|
-
21,Lists,Use getItemLayout for fixed height,Skip measurement for performance,getItemLayout when height known,Dynamic measurement for fixed items,"getItemLayout={(_, index) => ({ length: 50, offset: 50 * index, index })}",No getItemLayout for fixed height,Medium,
|
|
23
|
-
22,Lists,Implement windowSize,Control render window,Smaller windowSize for memory,Default windowSize for large lists,windowSize={5},windowSize={21} for huge lists,Medium,
|
|
24
|
-
23,Performance,Use React.memo,Prevent unnecessary re-renders,memo for pure components,No memoization,export default memo(MyComponent),export default MyComponent,Medium,
|
|
25
|
-
24,Performance,Use useCallback for handlers,Stable function references,useCallback for props,New function on every render,"useCallback(() => {}, [deps])",() => handlePress(),Medium,
|
|
26
|
-
25,Performance,Use useMemo for expensive ops,Cache expensive calculations,useMemo for heavy computations,Recalculate every render,"useMemo(() => expensive(), [deps])",const result = expensive(),Medium,
|
|
27
|
-
26,Performance,Avoid anonymous functions in JSX,Prevent re-renders,Named handlers or useCallback,Inline arrow functions,onPress={handlePress},onPress={() => doSomething()},Medium,
|
|
28
|
-
27,Performance,Use Hermes
|
|
29
|
-
28,Images,Use expo-image,Modern performant image component for React Native,"Use expo-image for caching, blurring, and performance",Use default Image for heavy lists or unmaintained libraries,<Image source={url} cachePolicy='memory-disk' /> (expo-image),<FastImage source={url} />,Medium,https://docs.expo.dev/versions/latest/sdk/image
|
|
30
|
-
29,Images,Specify image dimensions,Prevent layout shifts,width and height for remote images,No dimensions for network images,<Image style={{ width: 100 height: 100 }} />,<Image source={{ uri }} /> no size,High,
|
|
31
|
-
30,Images,Use resizeMode,Control image scaling,resizeMode cover contain,Stretch images,"resizeMode=""cover""",No resizeMode,Low,
|
|
32
|
-
31,Forms,Use controlled inputs,State-controlled form fields,value + onChangeText,Uncontrolled inputs,<TextInput value={text} onChangeText={setText} />,<TextInput defaultValue={text} />,Medium,
|
|
33
|
-
32,Forms,Handle keyboard,Manage keyboard visibility,KeyboardAvoidingView,Content hidden by keyboard,"<KeyboardAvoidingView behavior=""padding"">",No keyboard handling,High,https://reactnative.dev/docs/keyboardavoidingview
|
|
34
|
-
33,Forms,Use proper keyboard types,Appropriate keyboard for input,keyboardType for input type,Default keyboard for all,"keyboardType=""email-address""","keyboardType=""default"" for email",Low,
|
|
35
|
-
34,Touch,Use Pressable,Modern touch handling,Pressable for touch interactions,TouchableOpacity for new code,<Pressable onPress={} />,<TouchableOpacity onPress={} />,Low,https://reactnative.dev/docs/pressable
|
|
36
|
-
35,Touch,Provide touch feedback,Visual feedback on press,Ripple or opacity change,No feedback on press,android_ripple={{ color: 'gray' }},No press feedback,Medium,
|
|
37
|
-
36,Touch,Set hitSlop for small targets,Increase touch area,hitSlop for icons and small buttons,Tiny touch targets,hitSlop={{ top: 10 bottom: 10 }},44x44 with no hitSlop,Medium,
|
|
38
|
-
37,Animation,Use Reanimated,High-performance animations,react-native-reanimated,Animated API for complex,useSharedValue useAnimatedStyle,Animated.timing for gesture,Medium,https://docs.swmansion.com/react-native-reanimated
|
|
39
|
-
38,Animation,Run on UI thread,worklets for smooth animation,Run animations on UI thread,JS thread animations,runOnUI(() => {}),Animated on JS thread,High,
|
|
40
|
-
39,Animation,Use gesture handler,Native gesture recognition,react-native-gesture-handler,JS-based gesture handling,<GestureDetector>,<View onTouchMove={} />,Medium,https://docs.swmansion.com/react-native-gesture-handler
|
|
41
|
-
40,Async,Handle loading states,Show loading indicators,ActivityIndicator during load,Empty screen during load,{isLoading ? <ActivityIndicator /> : <Content />},No loading state,Medium,
|
|
42
|
-
41,Async,
|
|
43
|
-
42,Async,Cancel async operations,Cleanup on unmount,AbortController or cleanup,Memory leaks from async,useEffect cleanup,No cleanup for subscriptions,High,
|
|
44
|
-
43,Accessibility,Add accessibility labels,Describe UI elements,accessibilityLabel for all interactive,Missing labels,"accessibilityLabel=""Submit form""",<Pressable> without label,High,https://reactnative.dev/docs/accessibility
|
|
45
|
-
44,Accessibility,Use accessibility roles,Semantic meaning,accessibilityRole for elements,Wrong roles,"accessibilityRole=""button""",No role for button,Medium,
|
|
46
|
-
45,Accessibility,Support screen readers,Test with TalkBack/VoiceOver,Test with screen readers,Skip accessibility testing,Regular TalkBack testing,No screen reader testing,High,
|
|
47
|
-
46,Testing,Use React Native Testing Library,Component testing,render and fireEvent,Enzyme or manual testing,render(<Component />),shallow(<Component />),Medium,https://callstack.github.io/react-native-testing-library
|
|
48
|
-
47,Testing,Test on real devices,Real device behavior,Test on iOS and Android devices,Simulator only,Device testing in CI,Simulator only testing,High,
|
|
49
|
-
48,Testing,Use Detox for E2E,End-to-end testing,Detox for critical flows,Manual E2E testing,detox test,Manual testing only,Medium,https://wix.github.io/Detox
|
|
50
|
-
49,Native,Use native modules carefully,Bridge has overhead,Batch native calls,Frequent bridge crossing,Batch updates,Call native on every keystroke,High,
|
|
51
|
-
50,Native,Use Expo when possible,Simplified development,Expo for standard features,Bare RN for simple apps,expo install package,react-native link package,Low,https://docs.expo.dev
|
|
52
|
-
51,Native,Handle permissions,Request permissions properly,Check and request permissions,Assume permissions granted,PermissionsAndroid.request(),Access without permission check,High,https://reactnative.dev/docs/permissionsandroid
|
|
1
|
+
No,Category,Guideline,Description,Do,Don't,Code Good,Code Bad,Severity,Docs URL,Applies To,Status,Verified At
|
|
2
|
+
1,Components,Use functional components,Hooks-based components are standard,Functional components with hooks,Class components,const App = () => { },class App extends Component,Medium,https://reactnative.dev/docs/intro-react,react-native 0.86.x (official active line),active,2026-08-13
|
|
3
|
+
2,Components,Keep components small,Single responsibility principle,Split into smaller components,Large monolithic components,<Header /><Content /><Footer />,500+ line component,Medium,,react-native 0.86.x (official active line),active,2026-08-13
|
|
4
|
+
3,Components,Use TypeScript,Type safety for props and state,TypeScript for new projects,JavaScript without types,const Button: FC<Props> = () => { },const Button = (props) => { },Medium,,react-native 0.86.x (official active line),active,2026-08-13
|
|
5
|
+
4,Components,Colocate component files,Keep related files together,Component folder with styles,Flat structure,components/Button/index.tsx styles.ts,components/Button.tsx styles/button.ts,Low,,react-native 0.86.x (official active line),active,2026-08-13
|
|
6
|
+
5,Styling,Use StyleSheet.create,Optimized style objects,StyleSheet for all styles,Inline style objects,StyleSheet.create({ container: {} }),style={{ margin: 10 }},High,https://reactnative.dev/docs/stylesheet,react-native 0.86.x (official active line),active,2026-08-13
|
|
7
|
+
6,Styling,Avoid inline styles,Prevent object recreation,Styles in StyleSheet,Inline style objects in render,style={styles.container},"style={{ margin: 10, padding: 5 }}",Medium,,react-native 0.86.x (official active line),active,2026-08-13
|
|
8
|
+
7,Styling,Use flexbox for layout,React Native uses flexbox,flexDirection alignItems justifyContent,Absolute positioning everywhere,flexDirection: 'row',position: 'absolute' everywhere,Medium,https://reactnative.dev/docs/flexbox,react-native 0.86.x (official active line),active,2026-08-13
|
|
9
|
+
8,Styling,Handle platform differences,Platform-specific styles,Platform.select or .ios/.android files,Same styles for both platforms,"Platform.select({ ios: {}, android: {} })",Hardcoded iOS values,Medium,https://reactnative.dev/docs/platform-specific-code,react-native 0.86.x (official active line),active,2026-08-13
|
|
10
|
+
9,Styling,Use responsive dimensions,Scale for different screens,Dimensions or useWindowDimensions,Fixed pixel values,useWindowDimensions(),width: 375,Medium,,react-native 0.86.x (official active line),active,2026-08-13
|
|
11
|
+
10,Navigation,Use React Navigation,Standard navigation library,React Navigation for routing,Manual navigation management,createStackNavigator(),Custom navigation state,Medium,https://reactnavigation.org/,react-native 0.86.x (official active line),active,2026-08-13
|
|
12
|
+
11,Navigation,Type navigation params,Type-safe navigation,Typed navigation props,Untyped navigation,"navigation.navigate<RootStackParamList>('Home', { id })","navigation.navigate('Home', { id })",Medium,,react-native 0.86.x (official active line),active,2026-08-13
|
|
13
|
+
12,Navigation,Use deep linking,Support URL-based navigation,Configure linking prop,No deep link support,linking: { prefixes: [] },No linking configuration,Medium,https://reactnavigation.org/docs/deep-linking/,react-native 0.86.x (official active line),active,2026-08-13
|
|
14
|
+
13,Navigation,Handle back button,Android back button handling,useFocusEffect with BackHandler,Ignore back button,BackHandler.addEventListener,No back handler,High,https://reactnative.dev/docs/backhandler,react-native 0.86.x (official active line),active,2026-08-13
|
|
15
|
+
14,State,Use useState for local state,Simple component state,useState for UI state,Class component state,"const [count, setCount] = useState(0)",this.state = { count: 0 },Medium,,react-native 0.86.x (official active line),active,2026-08-13
|
|
16
|
+
15,State,Use useReducer for complex state,Complex state logic,useReducer for related state,Multiple useState for related values,useReducer(reducer initialState),5+ useState calls,Medium,,react-native 0.86.x (official active line),active,2026-08-13
|
|
17
|
+
16,State,Use context sparingly,Context for global state,Context for theme auth locale,Context for frequently changing data,ThemeContext for app theme,Context for list item data,Medium,,react-native 0.86.x (official active line),active,2026-08-13
|
|
18
|
+
17,State,Consider Zustand or Redux,External state management,Zustand for simple Redux for complex,useState for global state,create((set) => ({ })),Prop drilling global state,Medium,,react-native 0.86.x (official active line),active,2026-08-13
|
|
19
|
+
18,Lists,Use FlatList for long lists,Virtualized list rendering,FlatList for 50+ items,ScrollView with map,<FlatList data={items} />,<ScrollView>{items.map()}</ScrollView>,High,https://reactnative.dev/docs/flatlist,react-native 0.86.x (official active line),active,2026-08-13
|
|
20
|
+
19,Lists,Provide keyExtractor,Unique keys for list items,keyExtractor with stable ID,Index as key,keyExtractor={(item) => item.id},"keyExtractor={(_, index) => index}",High,https://reactnative.dev/docs/flatlist#keyextractor,react-native 0.86.x (official active line),active,2026-08-13
|
|
21
|
+
20,Lists,Optimize renderItem,Memoize list item components,React.memo for list items,Inline render function,renderItem={({ item }) => <MemoizedItem item={item} />},renderItem={({ item }) => <View>...</View>},High,https://reactnative.dev/docs/optimizing-flatlist-configuration,react-native 0.86.x (official active line),active,2026-08-13
|
|
22
|
+
21,Lists,Use getItemLayout for fixed height,Skip measurement for performance,getItemLayout when height known,Dynamic measurement for fixed items,"getItemLayout={(_, index) => ({ length: 50, offset: 50 * index, index })}",No getItemLayout for fixed height,Medium,,react-native 0.86.x (official active line),active,2026-08-13
|
|
23
|
+
22,Lists,Implement windowSize,Control render window,Smaller windowSize for memory,Default windowSize for large lists,windowSize={5},windowSize={21} for huge lists,Medium,,react-native 0.86.x (official active line),active,2026-08-13
|
|
24
|
+
23,Performance,Use React.memo,Prevent unnecessary re-renders,memo for pure components,No memoization,export default memo(MyComponent),export default MyComponent,Medium,,react-native 0.86.x (official active line),active,2026-08-13
|
|
25
|
+
24,Performance,Use useCallback for handlers,Stable function references,useCallback for props,New function on every render,"useCallback(() => {}, [deps])",() => handlePress(),Medium,,react-native 0.86.x (official active line),active,2026-08-13
|
|
26
|
+
25,Performance,Use useMemo for expensive ops,Cache expensive calculations,useMemo for heavy computations,Recalculate every render,"useMemo(() => expensive(), [deps])",const result = expensive(),Medium,,react-native 0.86.x (official active line),active,2026-08-13
|
|
27
|
+
26,Performance,Avoid anonymous functions in JSX,Prevent re-renders,Named handlers or useCallback,Inline arrow functions,onPress={handlePress},onPress={() => doSomething()},Medium,,react-native 0.86.x (official active line),active,2026-08-13
|
|
28
|
+
27,Performance,Use bundled Hermes by default,Hermes is bundled with React Native and enabled by default,Keep the bundled Hermes default unless an explicit compatibility need requires opt-out,Opt out of Hermes by default,Use the Hermes version bundled with React Native,Override the JavaScript engine without a verified requirement,Medium,https://reactnative.dev/architecture/bundled-hermes,react-native 0.86.x (official active line),active,2026-08-13
|
|
29
|
+
28,Images,Use expo-image,Modern performant image component for React Native,"Use expo-image for caching, blurring, and performance",Use default Image for heavy lists or unmaintained libraries,<Image source={url} cachePolicy='memory-disk' /> (expo-image),<FastImage source={url} />,Medium,https://docs.expo.dev/versions/latest/sdk/image/,react-native 0.86.x (official active line),active,2026-08-13
|
|
30
|
+
29,Images,Specify image dimensions,Prevent layout shifts,width and height for remote images,No dimensions for network images,<Image style={{ width: 100 height: 100 }} />,<Image source={{ uri }} /> no size,High,https://reactnative.dev/docs/images#network-images,react-native 0.86.x (official active line),active,2026-08-13
|
|
31
|
+
30,Images,Use resizeMode,Control image scaling,resizeMode cover contain,Stretch images,"resizeMode=""cover""",No resizeMode,Low,,react-native 0.86.x (official active line),active,2026-08-13
|
|
32
|
+
31,Forms,Use controlled inputs,State-controlled form fields,value + onChangeText,Uncontrolled inputs,<TextInput value={text} onChangeText={setText} />,<TextInput defaultValue={text} />,Medium,,react-native 0.86.x (official active line),active,2026-08-13
|
|
33
|
+
32,Forms,Handle keyboard,Manage keyboard visibility,KeyboardAvoidingView,Content hidden by keyboard,"<KeyboardAvoidingView behavior=""padding"">",No keyboard handling,High,https://reactnative.dev/docs/keyboardavoidingview,react-native 0.86.x (official active line),active,2026-08-13
|
|
34
|
+
33,Forms,Use proper keyboard types,Appropriate keyboard for input,keyboardType for input type,Default keyboard for all,"keyboardType=""email-address""","keyboardType=""default"" for email",Low,,react-native 0.86.x (official active line),active,2026-08-13
|
|
35
|
+
34,Touch,Use Pressable,Modern touch handling,Pressable for touch interactions,TouchableOpacity for new code,<Pressable onPress={} />,<TouchableOpacity onPress={} />,Low,https://reactnative.dev/docs/pressable,react-native 0.86.x (official active line),active,2026-08-13
|
|
36
|
+
35,Touch,Provide touch feedback,Visual feedback on press,Ripple or opacity change,No feedback on press,android_ripple={{ color: 'gray' }},No press feedback,Medium,,react-native 0.86.x (official active line),active,2026-08-13
|
|
37
|
+
36,Touch,Set hitSlop for small targets,Increase touch area,hitSlop for icons and small buttons,Tiny touch targets,hitSlop={{ top: 10 bottom: 10 }},44x44 with no hitSlop,Medium,,react-native 0.86.x (official active line),active,2026-08-13
|
|
38
|
+
37,Animation,Use Reanimated,High-performance animations,react-native-reanimated,Animated API for complex,useSharedValue useAnimatedStyle,Animated.timing for gesture,Medium,https://docs.swmansion.com/react-native-reanimated/,react-native 0.86.x (official active line),active,2026-08-13
|
|
39
|
+
38,Animation,Run on UI thread,worklets for smooth animation,Run animations on UI thread,JS thread animations,runOnUI(() => {}),Animated on JS thread,High,https://reactnative.dev/docs/performance,react-native 0.86.x (official active line),active,2026-08-13
|
|
40
|
+
39,Animation,Use gesture handler,Native gesture recognition,react-native-gesture-handler,JS-based gesture handling,<GestureDetector>,<View onTouchMove={} />,Medium,https://docs.swmansion.com/react-native-gesture-handler/,react-native 0.86.x (official active line),active,2026-08-13
|
|
41
|
+
40,Async,Handle loading states,Show loading indicators,ActivityIndicator during load,Empty screen during load,{isLoading ? <ActivityIndicator /> : <Content />},No loading state,Medium,,react-native 0.86.x (official active line),active,2026-08-13
|
|
42
|
+
41,Async,Use an error boundary for rendering failures,React error boundaries replace a crashed subtree with fallback UI,Catch rendering errors at a feature boundary and provide recovery,Let a render error unmount the whole app,<ErrorBoundary fallback={<ErrorView />}><Content /></ErrorBoundary>,Render the feature tree with no error boundary,High,https://react.dev/reference/react/Component#catching-rendering-errors-with-an-error-boundary,react-native 0.86.x (official active line),active,2026-08-13
|
|
43
|
+
42,Async,Cancel async operations,Cleanup on unmount,AbortController or cleanup,Memory leaks from async,useEffect cleanup,No cleanup for subscriptions,High,https://reactnative.dev/docs/global-AbortController,react-native 0.86.x (official active line),active,2026-08-13
|
|
44
|
+
43,Accessibility,Add accessibility labels,Describe UI elements,accessibilityLabel for all interactive,Missing labels,"accessibilityLabel=""Submit form""",<Pressable> without label,High,https://reactnative.dev/docs/accessibility,react-native 0.86.x (official active line),active,2026-08-13
|
|
45
|
+
44,Accessibility,Use accessibility roles,Semantic meaning,accessibilityRole for elements,Wrong roles,"accessibilityRole=""button""",No role for button,Medium,,react-native 0.86.x (official active line),active,2026-08-13
|
|
46
|
+
45,Accessibility,Support screen readers,Test with TalkBack/VoiceOver,Test with screen readers,Skip accessibility testing,Regular TalkBack testing,No screen reader testing,High,https://reactnative.dev/docs/accessibility#testing-talkback-support,react-native 0.86.x (official active line),active,2026-08-13
|
|
47
|
+
46,Testing,Use React Native Testing Library,Component testing,render and fireEvent,Enzyme or manual testing,render(<Component />),shallow(<Component />),Medium,https://callstack.github.io/react-native-testing-library/,react-native 0.86.x (official active line),active,2026-08-13
|
|
48
|
+
47,Testing,Test on real devices,Real device behavior,Test on iOS and Android devices,Simulator only,Device testing in CI,Simulator only testing,High,https://reactnative.dev/docs/running-on-device,react-native 0.86.x (official active line),active,2026-08-13
|
|
49
|
+
48,Testing,Use Detox for E2E,End-to-end testing,Detox for critical flows,Manual E2E testing,detox test,Manual testing only,Medium,https://wix.github.io/Detox/,react-native 0.86.x (official active line),active,2026-08-13
|
|
50
|
+
49,Native,Use native modules carefully,Bridge has overhead,Batch native calls,Frequent bridge crossing,Batch updates,Call native on every keystroke,High,https://reactnative.dev/docs/turbo-native-modules-introduction,react-native 0.86.x (official active line),active,2026-08-13
|
|
51
|
+
50,Native,Use Expo when possible,Simplified development,Expo for standard features,Bare RN for simple apps,expo install package,react-native link package,Low,https://docs.expo.dev/,react-native 0.86.x (official active line),active,2026-08-13
|
|
52
|
+
51,Native,Handle permissions,Request permissions properly,Check and request permissions,Assume permissions granted,PermissionsAndroid.request(),Access without permission check,High,https://reactnative.dev/docs/permissionsandroid,react-native 0.86.x (official active line),active,2026-08-13
|
|
@@ -1,54 +1,67 @@
|
|
|
1
|
-
No,Category,Guideline,Description,Do,Don't,Code Good,Code Bad,Severity,Docs URL
|
|
2
|
-
1,State,Use useState for local state,Simple component state should use useState hook
|
|
3
|
-
2,State,Lift state up when needed,Share state between siblings by lifting to parent,Lift shared state to common ancestor,Prop drilling through many levels,Parent holds state passes down,Deep prop chains,Medium,https://react.dev/learn/sharing-state-between-components
|
|
4
|
-
3,State,Use useReducer for complex state,Complex state logic benefits from reducer pattern,useReducer for state with multiple sub-values,Multiple useState for related values,useReducer with action types,5+ useState calls that update together,Medium,https://react.dev/reference/react/useReducer
|
|
5
|
-
4,State,Avoid unnecessary state,Derive values from existing state when possible,Compute derived values in render,Store derivable values in state,const total = items.reduce(...),"const [total, setTotal] = useState(0)",High,https://react.dev/learn/choosing-the-state-structure
|
|
6
|
-
5,State,Initialize state lazily,Use function form for expensive initial state,useState(() => computeExpensive()),useState(computeExpensive()),useState(() => JSON.parse(data)),useState(JSON.parse(data)),Medium,https://react.dev/reference/react/useState#avoiding-recreating-the-initial-state
|
|
7
|
-
6,Effects,Clean up effects,Return cleanup
|
|
8
|
-
7,Effects,Specify dependencies correctly,Include
|
|
9
|
-
8,Effects,Avoid unnecessary effects,
|
|
10
|
-
9,Effects,Use refs for non-reactive values,Store values that don't trigger re-renders in refs,useRef for interval IDs DOM elements,useState for values that don't need render,const intervalRef = useRef(null),"const [intervalId, setIntervalId] = useState()",Medium,https://react.dev/reference/react/useRef
|
|
11
|
-
10,Rendering,Use keys properly,Stable unique keys for list items,Use stable IDs as keys,Array index as key for dynamic lists,key={item.id},key={index},High,https://react.dev/learn/rendering-lists#keeping-list-items-in-order-with-key
|
|
12
|
-
11,Rendering,Memoize expensive calculations,
|
|
13
|
-
12,Rendering,Memoize callbacks passed to children,Use useCallback for
|
|
14
|
-
13,Rendering,Use React.memo wisely,
|
|
15
|
-
14,Rendering,Avoid inline object/array creation in JSX,Create objects outside render or memoize,Define style objects outside component,Inline objects in props,<div style={styles.container}>,<div style={{ margin: 10 }}>,Medium,
|
|
16
|
-
15,Components,Keep components small and focused,Single responsibility for each component,One concern per component,Large multi-purpose components,<UserAvatar /><UserName />,<UserCard /> with 500 lines,Medium,
|
|
17
|
-
16,Components,Use composition over inheritance,Compose components using children and props,Use children prop for flexibility,Inheritance hierarchies,<Card>{content}</Card>,class SpecialCard extends Card,Medium,https://react.dev/learn/thinking-in-react
|
|
18
|
-
17,Components,Colocate related code,Keep related components and hooks together,Related files in same directory,Flat structure with many files,components/User/UserCard.tsx,components/UserCard.tsx + hooks/useUser.ts,Low,
|
|
19
|
-
18,Components,Use fragments to avoid extra DOM,Fragment or <> for multiple elements without wrapper,<> for grouping without DOM node,Extra div wrappers,<>{items.map(...)}</>,<div>{items.map(...)}</div>,Low,https://react.dev/reference/react/Fragment
|
|
20
|
-
19,Props,Destructure props,Destructure props for cleaner component code,Destructure in function signature,props.name props.value throughout,"function User({ name, age })",function User(props),Low,
|
|
21
|
-
20,Props,Provide default props values,Use default parameters or defaultProps,Default values in destructuring,Undefined checks throughout,function Button({ size = 'md' }),if (size === undefined) size = 'md',Low,
|
|
22
|
-
21,Props,Avoid prop drilling,Use context or composition for deeply nested data,Context for global data composition for UI,Passing props through 5+ levels,<UserContext.Provider>,<A user={u}><B user={u}><C user={u}>,Medium,https://react.dev/learn/passing-data-deeply-with-context
|
|
23
|
-
22,Props,Validate props with TypeScript,Use TypeScript interfaces for prop types,interface Props { name: string },PropTypes or no validation,interface ButtonProps { onClick: () => void },Button.propTypes = {},Medium,
|
|
24
|
-
23,Events,Use synthetic events correctly,React normalizes events across browsers,e.preventDefault() e.stopPropagation(),Access native event unnecessarily,onClick={(e) => e.preventDefault()},onClick={(e) => e.nativeEvent.preventDefault()},Low,https://react.dev/reference/react-dom/components/common#react-event-object
|
|
25
|
-
24,Events,Avoid binding in render,Use arrow functions in class or hooks,Arrow functions in functional components,bind in render or constructor,const handleClick = () => {},this.handleClick.bind(this),Medium,
|
|
26
|
-
25,Events,Pass event handlers not call results,Pass function reference not invocation,onClick={handleClick},onClick={handleClick()} causing immediate call,onClick={handleClick},onClick={handleClick()},High,
|
|
27
|
-
26,Forms,Controlled components for forms,Use state to control form inputs,value + onChange for inputs,Uncontrolled inputs with refs,<input value={val} onChange={setVal}>,<input ref={inputRef}>,Medium,https://react.dev/reference/react-dom/components/input#controlling-an-input-with-a-state-variable
|
|
28
|
-
27,Forms,Handle form submission properly,Prevent default and handle in submit handler,onSubmit with preventDefault,onClick on submit button only,<form onSubmit={handleSubmit}>,<button onClick={handleSubmit}>,Medium,
|
|
29
|
-
28,Forms,Debounce rapid input changes,Debounce search/filter inputs,useDeferredValue or debounce for search,Filter on every keystroke,useDeferredValue(searchTerm),useEffect filtering on every change,Medium,https://react.dev/reference/react/useDeferredValue
|
|
30
|
-
29,Hooks,Follow rules of hooks,Only call hooks at top level
|
|
31
|
-
30,Hooks,Custom hooks for reusable logic,Extract shared stateful logic to custom hooks,useCustomHook for reusable patterns,Duplicate hook logic across components,const { data } = useFetch(url),Duplicate useEffect/useState in components,Medium,https://react.dev/learn/reusing-logic-with-custom-hooks
|
|
32
|
-
31,Hooks,Name custom hooks with use prefix,Custom hooks must start with use,useFetch useForm useAuth,fetchData or getData for hook,function useFetch(url),function fetchData(url),High,
|
|
33
|
-
32,Context,Use context for global data,Context for theme auth locale,Context for app-wide state,Context for frequently changing data,<ThemeContext.Provider>,Context for form field values,Medium,https://react.dev/learn/passing-data-deeply-with-context
|
|
34
|
-
33,Context,Split contexts by concern,Separate contexts for different domains,ThemeContext + AuthContext,One giant AppContext,<ThemeProvider><AuthProvider>,<AppProvider value={{theme user...}}>,Medium,
|
|
35
|
-
34,Context,Memoize context values,Prevent unnecessary re-renders with useMemo,useMemo for context value object,New object reference every render,"value={useMemo(() => ({...}), [])}","value={{ user, theme }}",High,
|
|
36
|
-
35,Performance,Use React DevTools Profiler,Profile to identify performance bottlenecks,Profile before optimizing,Optimize without measuring,React DevTools Profiler,Guessing at bottlenecks,Medium,https://react.dev/learn/react-developer-tools
|
|
37
|
-
36,Performance,Lazy load components,Use React.lazy for code splitting,lazy() for routes and heavy components,Import everything upfront,const Page = lazy(() => import('./Page')),import Page from './Page',Medium,https://react.dev/reference/react/lazy
|
|
38
|
-
37,Performance,Virtualize long lists,Use windowing for lists over 100 items,react-window or react-virtual,Render thousands of DOM nodes,<VirtualizedList items={items}/>,{items.map(i => <Item />)},High,
|
|
39
|
-
38,Performance,Batch state updates,
|
|
40
|
-
39,ErrorHandling,Use error boundaries,Catch JavaScript errors in component tree,ErrorBoundary wrapping sections,Let errors crash entire app,<ErrorBoundary><App/></ErrorBoundary>,No error handling,High,https://react.dev/reference/react/Component#catching-rendering-errors-with-an-error-boundary
|
|
41
|
-
40,ErrorHandling,Handle async errors,Catch errors in async operations,
|
|
42
|
-
41,Testing,Test behavior not implementation,Test what user sees and does,Test renders and interactions,Test internal state or methods,expect(screen.getByText('Hello')),expect(component.state.name),Medium,https://testing-library.com/docs/react-testing-library/intro
|
|
43
|
-
42,Testing,Use testing-library queries,Use accessible queries,getByRole getByLabelText,getByTestId for everything,getByRole('button'),getByTestId('submit-btn'),Medium,https://testing-library.com/docs/queries/about#priority
|
|
44
|
-
43,Accessibility,Use semantic HTML,
|
|
45
|
-
44,Accessibility,Manage focus properly,Handle focus for modals dialogs,Focus trap in modals return focus on close,No focus management,useEffect to focus input,Modal without focus trap,High,
|
|
46
|
-
45,Accessibility,Announce dynamic content,Use ARIA live regions for updates,aria-live for dynamic updates,Silent updates to screen readers,"<div aria-live=""polite"">{msg}</div>",<div>{msg}</div>,Medium,
|
|
47
|
-
46,Accessibility,Label form controls,Associate labels with inputs,htmlFor matching input id,Placeholder as only label,"<label htmlFor=""email"">Email</label>","<input placeholder=""Email""/>",High,
|
|
48
|
-
47,TypeScript,Type component props,Define interfaces for all props,interface Props with all prop types,any or missing types,interface Props { name: string },function Component(props: any),High,
|
|
49
|
-
48,TypeScript,Type state properly,Provide types for useState,useState<Type>() for complex state,Inferred any types,useState<User | null>(null),useState(null),Medium,
|
|
50
|
-
49,TypeScript,Type event handlers,Use React event types,React.ChangeEvent<HTMLInputElement>,Generic Event type,onChange: React.ChangeEvent<HTMLInputElement>,onChange: Event,Medium,
|
|
51
|
-
50,TypeScript,Use generics for reusable components,Generic components for flexible typing,Generic props for list components,Union types for flexibility,<List<T> items={T[]}>,<List items={any[]}>,Medium,
|
|
52
|
-
51,Patterns,Container/Presentational split,Separate data logic from UI,Container fetches presentational renders,Mixed data and UI in one,<UserContainer><UserView/></UserContainer>,<User /> with fetch and render,Low,
|
|
53
|
-
52,Patterns,Render props for flexibility,Share code via render prop pattern,Render prop for customizable rendering,Duplicate logic across components,<DataFetcher render={data => ...}/>,Copy paste fetch logic,Low,https://react.dev/reference/react/cloneElement#passing-data-with-a-render-prop
|
|
54
|
-
53,Patterns,Compound components,Related components sharing state,Tab + TabPanel sharing context,Prop drilling between related,<Tabs><Tab/><TabPanel/></Tabs>,<Tabs tabs={[]} panels={[...]}/>,Low,
|
|
1
|
+
No,Category,Guideline,Description,Do,Don't,Code Good,Code Bad,Severity,Docs URL,Applies To,Status,Verified At
|
|
2
|
+
1,State,Use useState for local state,Simple component state should use useState hook in current React apps.,useState for form inputs toggles counters,Class components this.state,"const [count, setCount] = useState(0)",this.state = { count: 0 },Medium,https://react.dev/reference/react/useState,react 19.2.x,active,2026-08-13
|
|
3
|
+
2,State,Lift state up when needed,Share state between siblings by lifting to parent,Lift shared state to common ancestor,Prop drilling through many levels,Parent holds state passes down,Deep prop chains,Medium,https://react.dev/learn/sharing-state-between-components,react 19.2.x,active,2026-08-13
|
|
4
|
+
3,State,Use useReducer for complex state,Complex state logic benefits from reducer pattern,useReducer for state with multiple sub-values,Multiple useState for related values,useReducer with action types,5+ useState calls that update together,Medium,https://react.dev/reference/react/useReducer,react 19.2.x,active,2026-08-13
|
|
5
|
+
4,State,Avoid unnecessary state,Derive values from existing state when possible,Compute derived values in render,Store derivable values in state,const total = items.reduce(...),"const [total, setTotal] = useState(0)",High,https://react.dev/learn/choosing-the-state-structure,react 19.2.x,active,2026-08-13
|
|
6
|
+
5,State,Initialize state lazily,Use function form for expensive initial state,useState(() => computeExpensive()),useState(computeExpensive()),useState(() => JSON.parse(data)),useState(JSON.parse(data)),Medium,https://react.dev/reference/react/useState#avoiding-recreating-the-initial-state,react 19.2.x,active,2026-08-13
|
|
7
|
+
6,Effects,Clean up effects,Return cleanup for subscriptions and timers so effects stay predictable.,Return cleanup function in useEffect,No cleanup for subscriptions,useEffect(() => { sub(); return unsub; }),useEffect(() => { subscribe(); }),High,https://react.dev/reference/react/useEffect#connecting-to-an-external-system,react 19.2.x,active,2026-08-13
|
|
8
|
+
7,Effects,Specify dependencies correctly,Include every reactive value used inside an Effect dependency array.,All referenced values in dependency array,Empty deps with external references,[value] when using value in effect,[] when using props/state in effect,High,https://react.dev/reference/react/useEffect#specifying-reactive-dependencies,react 19.2.x,active,2026-08-13
|
|
9
|
+
8,Effects,Avoid unnecessary effects,Avoid Effects for derived data or event handling.,Transform data during render handle events directly,useEffect for derived state or event handling,const filtered = items.filter(...),useEffect(() => setFiltered(items.filter(...))),High,https://react.dev/learn/you-might-not-need-an-effect,react 19.2.x,active,2026-08-13
|
|
10
|
+
9,Effects,Use refs for non-reactive values,Store values that don't trigger re-renders in refs,useRef for interval IDs DOM elements,useState for values that don't need render,const intervalRef = useRef(null),"const [intervalId, setIntervalId] = useState()",Medium,https://react.dev/reference/react/useRef,react 19.2.x,active,2026-08-13
|
|
11
|
+
10,Rendering,Use keys properly,Stable unique keys for list items,Use stable IDs as keys,Array index as key for dynamic lists,key={item.id},key={index},High,https://react.dev/learn/rendering-lists#keeping-list-items-in-order-with-key,react 19.2.x,active,2026-08-13
|
|
12
|
+
11,Rendering,Memoize expensive calculations,Prefer compiler-first memoization; use useMemo only for measured hotspots or explicit cache boundaries.,Use useMemo for expensive computations when profiling shows a real bottleneck,Use useMemo everywhere by default,"useMemo(() => expensive(), [deps])",const result = expensiveCalc(),Medium,https://react.dev/reference/react/useMemo,react 19.2.x,active,2026-08-13
|
|
13
|
+
12,Rendering,Memoize callbacks passed to children,Use useCallback only when callback identity matters for measured child renders.,Use useCallback for handlers passed to memoized children when identity is a bottleneck,Wrap every function in useCallback by default,"useCallback(() => {}, [deps])",const handler = () => {},Medium,https://react.dev/reference/react/useCallback,react 19.2.x,active,2026-08-13
|
|
14
|
+
13,Rendering,Use React.memo wisely,"Keep React.memo as a measured optimization, not a blanket default.",Use React.memo for pure components with stable props and real render cost,Memoize every component or use it as a guess,memo(ExpensiveList),memo(SimpleButton),Low,https://react.dev/reference/react/memo,react 19.2.x,active,2026-08-13
|
|
15
|
+
14,Rendering,Avoid inline object/array creation in JSX,Create objects outside render or memoize,Define style objects outside component,Inline objects in props,<div style={styles.container}>,<div style={{ margin: 10 }}>,Medium,,react 19.2.x,active,2026-08-13
|
|
16
|
+
15,Components,Keep components small and focused,Single responsibility for each component,One concern per component,Large multi-purpose components,<UserAvatar /><UserName />,<UserCard /> with 500 lines,Medium,,react 19.2.x,active,2026-08-13
|
|
17
|
+
16,Components,Use composition over inheritance,Compose components using children and props,Use children prop for flexibility,Inheritance hierarchies,<Card>{content}</Card>,class SpecialCard extends Card,Medium,https://react.dev/learn/thinking-in-react,react 19.2.x,active,2026-08-13
|
|
18
|
+
17,Components,Colocate related code,Keep related components and hooks together,Related files in same directory,Flat structure with many files,components/User/UserCard.tsx,components/UserCard.tsx + hooks/useUser.ts,Low,,react 19.2.x,active,2026-08-13
|
|
19
|
+
18,Components,Use fragments to avoid extra DOM,Fragment or <> for multiple elements without wrapper,<> for grouping without DOM node,Extra div wrappers,<>{items.map(...)}</>,<div>{items.map(...)}</div>,Low,https://react.dev/reference/react/Fragment,react 19.2.x,active,2026-08-13
|
|
20
|
+
19,Props,Destructure props,Destructure props for cleaner component code,Destructure in function signature,props.name props.value throughout,"function User({ name, age })",function User(props),Low,,react 19.2.x,active,2026-08-13
|
|
21
|
+
20,Props,Provide default props values,Use default parameters or defaultProps,Default values in destructuring,Undefined checks throughout,function Button({ size = 'md' }),if (size === undefined) size = 'md',Low,,react 19.2.x,active,2026-08-13
|
|
22
|
+
21,Props,Avoid prop drilling,Use context or composition for deeply nested data,Context for global data composition for UI,Passing props through 5+ levels,<UserContext.Provider>,<A user={u}><B user={u}><C user={u}>,Medium,https://react.dev/learn/passing-data-deeply-with-context,react 19.2.x,active,2026-08-13
|
|
23
|
+
22,Props,Validate props with TypeScript,Use TypeScript interfaces for prop types,interface Props { name: string },PropTypes or no validation,interface ButtonProps { onClick: () => void },Button.propTypes = {},Medium,,react 19.2.x,active,2026-08-13
|
|
24
|
+
23,Events,Use synthetic events correctly,React normalizes events across browsers,e.preventDefault() e.stopPropagation(),Access native event unnecessarily,onClick={(e) => e.preventDefault()},onClick={(e) => e.nativeEvent.preventDefault()},Low,https://react.dev/reference/react-dom/components/common#react-event-object,react 19.2.x,active,2026-08-13
|
|
25
|
+
24,Events,Avoid binding in render,Use arrow functions in class or hooks,Arrow functions in functional components,bind in render or constructor,const handleClick = () => {},this.handleClick.bind(this),Medium,,react 19.2.x,active,2026-08-13
|
|
26
|
+
25,Events,Pass event handlers not call results,Pass function reference not invocation,onClick={handleClick},onClick={handleClick()} causing immediate call,onClick={handleClick},onClick={handleClick()},High,https://react.dev/learn/responding-to-events,react 19.2.x,active,2026-08-13
|
|
27
|
+
26,Forms,Controlled components for forms,Use state to control form inputs,value + onChange for inputs,Uncontrolled inputs with refs,<input value={val} onChange={setVal}>,<input ref={inputRef}>,Medium,https://react.dev/reference/react-dom/components/input#controlling-an-input-with-a-state-variable,react 19.2.x,active,2026-08-13
|
|
28
|
+
27,Forms,Handle form submission properly,Prevent default and handle in submit handler,onSubmit with preventDefault,onClick on submit button only,<form onSubmit={handleSubmit}>,<button onClick={handleSubmit}>,Medium,,react 19.2.x,active,2026-08-13
|
|
29
|
+
28,Forms,Debounce rapid input changes,Debounce search/filter inputs,useDeferredValue or debounce for search,Filter on every keystroke,useDeferredValue(searchTerm),useEffect filtering on every change,Medium,https://react.dev/reference/react/useDeferredValue,react 19.2.x,active,2026-08-13
|
|
30
|
+
29,Hooks,Follow rules of hooks,Only call hooks at the top level of React components or custom hooks.,Hooks at component top level,Hooks in conditions loops or callbacks,"const [x, setX] = useState()","if (cond) { const [x, setX] = useState() }",High,https://react.dev/reference/rules/rules-of-hooks,react 19.2.x,active,2026-08-13
|
|
31
|
+
30,Hooks,Custom hooks for reusable logic,Extract shared stateful logic to custom hooks,useCustomHook for reusable patterns,Duplicate hook logic across components,const { data } = useFetch(url),Duplicate useEffect/useState in components,Medium,https://react.dev/learn/reusing-logic-with-custom-hooks,react 19.2.x,active,2026-08-13
|
|
32
|
+
31,Hooks,Name custom hooks with use prefix,Custom hooks must start with use,useFetch useForm useAuth,fetchData or getData for hook,function useFetch(url),function fetchData(url),High,https://react.dev/learn/reusing-logic-with-custom-hooks,react 19.2.x,active,2026-08-13
|
|
33
|
+
32,Context,Use context for global data,Context for theme auth locale,Context for app-wide state,Context for frequently changing data,<ThemeContext.Provider>,Context for form field values,Medium,https://react.dev/learn/passing-data-deeply-with-context,react 19.2.x,active,2026-08-13
|
|
34
|
+
33,Context,Split contexts by concern,Separate contexts for different domains,ThemeContext + AuthContext,One giant AppContext,<ThemeProvider><AuthProvider>,<AppProvider value={{theme user...}}>,Medium,,react 19.2.x,active,2026-08-13
|
|
35
|
+
34,Context,Memoize context values,Prevent unnecessary re-renders with useMemo,useMemo for context value object,New object reference every render,"value={useMemo(() => ({...}), [])}","value={{ user, theme }}",High,https://react.dev/reference/react/useMemo,react 19.2.x,active,2026-08-13
|
|
36
|
+
35,Performance,Use React DevTools Profiler,Profile to identify performance bottlenecks,Profile before optimizing,Optimize without measuring,React DevTools Profiler,Guessing at bottlenecks,Medium,https://react.dev/learn/react-developer-tools,react 19.2.x,active,2026-08-13
|
|
37
|
+
36,Performance,Lazy load components,Use React.lazy for code splitting,lazy() for routes and heavy components,Import everything upfront,const Page = lazy(() => import('./Page')),import Page from './Page',Medium,https://react.dev/reference/react/lazy,react 19.2.x,active,2026-08-13
|
|
38
|
+
37,Performance,Virtualize long lists,Use windowing for lists over 100 items,react-window or react-virtual,Render thousands of DOM nodes,<VirtualizedList items={items}/>,{items.map(i => <Item />)},High,https://react.dev/learn/rendering-lists,react 19.2.x,active,2026-08-13
|
|
39
|
+
38,Performance,Batch state updates,flushSync is a rare escape hatch for synchronous DOM reads/writes.,Let React batch related updates; use flushSync only when synchronous DOM work is required,Use flushSync as a normal batching tool,setA(1); setB(2); // batched,flushSync(() => setA(1)),Low,https://react.dev/learn/queueing-a-series-of-state-updates,react 19.2.x,active,2026-08-13
|
|
40
|
+
39,ErrorHandling,Use error boundaries,Catch JavaScript errors in component tree,ErrorBoundary wrapping sections,Let errors crash entire app,<ErrorBoundary><App/></ErrorBoundary>,No error handling,High,https://react.dev/reference/react/Component#catching-rendering-errors-with-an-error-boundary,react 19.2.x,active,2026-08-13
|
|
41
|
+
40,ErrorHandling,Handle async errors,Catch errors in async operations and surface failures,Handle or report caught errors,Unhandled or silently swallowed promise rejections,try { await save() } catch (error) { setError(error) },await save() // no catch,High,https://react.dev/reference/react/useEffect,react 19.2.x,active,2026-08-13
|
|
42
|
+
41,Testing,Test behavior not implementation,Test what user sees and does,Test renders and interactions,Test internal state or methods,expect(screen.getByText('Hello')),expect(component.state.name),Medium,https://testing-library.com/docs/react-testing-library/intro/,react 19.2.x,active,2026-08-13
|
|
43
|
+
42,Testing,Use testing-library queries,Use accessible queries,getByRole getByLabelText,getByTestId for everything,getByRole('button'),getByTestId('submit-btn'),Medium,https://testing-library.com/docs/queries/about#priority,react 19.2.x,active,2026-08-13
|
|
44
|
+
43,Accessibility,Use semantic HTML,Use semantic HTML elements for their intended behavior.,button for clicks nav for navigation,div with onClick for buttons,<button onClick={...}>,<div onClick={...}>,High,https://react.dev/reference/react-dom/components#all-html-components,react 19.2.x,active,2026-08-13
|
|
45
|
+
44,Accessibility,Manage focus properly,Handle focus for modals dialogs,Focus trap in modals return focus on close,No focus management,useEffect to focus input,Modal without focus trap,High,https://react.dev/reference/react/useRef,react 19.2.x,active,2026-08-13
|
|
46
|
+
45,Accessibility,Announce dynamic content,Use ARIA live regions for updates,aria-live for dynamic updates,Silent updates to screen readers,"<div aria-live=""polite"">{msg}</div>",<div>{msg}</div>,Medium,,react 19.2.x,active,2026-08-13
|
|
47
|
+
46,Accessibility,Label form controls,Associate labels with inputs,htmlFor matching input id,Placeholder as only label,"<label htmlFor=""email"">Email</label>","<input placeholder=""Email""/>",High,https://react.dev/reference/react-dom/components/input,react 19.2.x,active,2026-08-13
|
|
48
|
+
47,TypeScript,Type component props,Define interfaces for all props,interface Props with all prop types,any or missing types,interface Props { name: string },function Component(props: any),High,https://react.dev/learn/passing-props-to-a-component,react 19.2.x,active,2026-08-13
|
|
49
|
+
48,TypeScript,Type state properly,Provide types for useState,useState<Type>() for complex state,Inferred any types,useState<User | null>(null),useState(null),Medium,,react 19.2.x,active,2026-08-13
|
|
50
|
+
49,TypeScript,Type event handlers,Use React event types,React.ChangeEvent<HTMLInputElement>,Generic Event type,onChange: React.ChangeEvent<HTMLInputElement>,onChange: Event,Medium,,react 19.2.x,active,2026-08-13
|
|
51
|
+
50,TypeScript,Use generics for reusable components,Generic components for flexible typing,Generic props for list components,Union types for flexibility,<List<T> items={T[]}>,<List items={any[]}>,Medium,,react 19.2.x,active,2026-08-13
|
|
52
|
+
51,Patterns,Container/Presentational split,Separate data logic from UI,Container fetches presentational renders,Mixed data and UI in one,<UserContainer><UserView/></UserContainer>,<User /> with fetch and render,Low,,react 19.2.x,active,2026-08-13
|
|
53
|
+
52,Patterns,Render props for flexibility,Share code via render prop pattern,Render prop for customizable rendering,Duplicate logic across components,<DataFetcher render={data => ...}/>,Copy paste fetch logic,Low,https://react.dev/reference/react/cloneElement#passing-data-with-a-render-prop,react 19.2.x,active,2026-08-13
|
|
54
|
+
53,Patterns,Compound components,Related components sharing state,Tab + TabPanel sharing context,Prop drilling between related,<Tabs><Tab/><TabPanel/></Tabs>,<Tabs tabs={[]} panels={[...]}/>,Low,,react 19.2.x,active,2026-08-13
|
|
55
|
+
54,Performance,Use React Compiler first for memoization,React Compiler provides automatic memoization; keep manual memoization only for measured hotspots or unsupported cases.,"Enable the compiler, then use manual memoization only when profiling proves it helps","Treat useMemo, useCallback, or React.memo as the default first answer",compiler-backed build plus measured useMemo or useCallback only when needed,blanket manual memoization everywhere,High,https://react.dev/blog/2025/10/07/react-compiler-1,react 19.2.x,active,2026-08-13
|
|
56
|
+
55,Tooling,Use eslint-plugin-react-hooks recommended preset,React Compiler lint rules now ship through eslint-plugin-react-hooks recommended presets.,Use the recommended hooks preset with compiler-aware linting,Pin older compiler-lint packages as the primary workflow,reactHooks.configs.flat.recommended,eslint-plugin-react-compiler as the main lint path,Medium,https://react.dev/blog/2025/10/07/react-compiler-1,react 19.2.x,active,2026-08-13
|
|
57
|
+
56,Hooks,Use an Effect Event for non-reactive effect logic,Use useEffectEvent to separate event-like logic from reactive Effect dependencies.,Read latest props and state inside useEffectEvent callbacks,Use useEffectEvent to hide missing dependencies,"const onConnected = useEffectEvent(() => showNotification('Connected!', theme))","useEffect(() => { log(theme) }, [])",High,https://react.dev/reference/react/useEffectEvent,react 19.2.x,active,2026-08-13
|
|
58
|
+
57,Concurrency,Use Actions with async startTransition,React 19 Actions let async state updates run as one transition and include side effects.,Wrap background state updates and async work in startTransition,Assume Actions are only for synchronous state updates,startTransition(async () => { await save(); setState(next) }),await save(); setState(next),Medium,https://react.dev/reference/react/startTransition,react 19.2.x,active,2026-08-13
|
|
59
|
+
58,Components,Pass ref as a prop,React 19 supports ref as a prop; this is the current path for exposing DOM nodes.,Accept ref as a normal prop in new components,Reach for forwardRef in new code,"function Input({ ref, ...props }) { return <input ref={ref} {...props} /> }","const Input = forwardRef(function Input(props, ref) { ... })",Medium,https://react.dev/reference/react/forwardRef,react 19.2.x,active,2026-08-13
|
|
60
|
+
59,Components,Avoid forwardRef in new code,forwardRef is deprecated in React 19 and should be treated as legacy compatibility code.,Migrate to ref as a prop for new and touched components,Introduce new forwardRef wrappers,legacy wrapper only while migrating older code,forwardRef for all new components,High,https://react.dev/reference/react/forwardRef,react legacy,deprecated,2026-08-13
|
|
61
|
+
60,Security,Require React 19.2.1+ for RSC code paths,React Server Components had an unauthenticated RCE in 19.2.0; treat 19.2.1+ as the security floor.,Pin React RSC stacks to 19.2.1 or newer,Ship 19.2.0 or older on any RSC endpoint,react@19.2.1+ react-dom@19.2.1+,react@19.2.0,Critical,https://react.dev/blog/2025/12/03/critical-security-vulnerability-in-react-server-components,react 19.2.x,active,2026-08-13
|
|
62
|
+
61,Tooling,Treat eslint-plugin-react-compiler as legacy,The React Compiler release recommends eslint-plugin-react-hooks instead of the older compiler-only lint package.,Use eslint-plugin-react-hooks recommended presets,Standardize on eslint-plugin-react-compiler,plugin:react-hooks/recommended,eslint-plugin-react-compiler,Medium,https://react.dev/blog/2025/10/07/react-compiler-1,react legacy,deprecated,2026-08-13
|
|
63
|
+
62,Forms,Use useActionState for Action state,Track the result and pending status of a side-effecting Action.,Pass its dispatch to a form action or call it inside startTransition,Call the returned dispatch directly outside an Action,<form action={formAction}>...</form>,formAction(formData) // outside an Action,High,https://react.dev/reference/react/useActionState,react 19.2.x,active,2026-09-21
|
|
64
|
+
63,Forms,Call useFormStatus from a form child,Reads submission status from the nearest parent form.,Call it in a child rendered inside the form,Call it in the component that renders the form,function Submit(){ const { pending } = useFormStatus(); return <button disabled={pending}>Save</button> },function Form(){ const { pending } = useFormStatus(); return <form>...</form> },High,https://react.dev/reference/react-dom/hooks/useFormStatus,react 19.2.x,active,2026-09-21
|
|
65
|
+
64,Hooks,Use use() with stable promises or context,Reads context or suspends on a promise until it resolves.,Pass a cached or otherwise stable promise to use(),Create a new promise during render,const data = use(dataPromise),const data = use(fetch('/api/data')),Medium,https://react.dev/reference/react/use,react 19.2.x,active,2026-09-21
|
|
66
|
+
65,Concurrency,Call useOptimistic updates inside an Action,Temporarily shows the expected state while an Action is pending.,Call the optimistic setter inside startTransition or an action prop,Call the optimistic setter outside an Action,startTransition(async () => { addOptimistic(item); await save(item); }),addOptimistic(item); await save(item),Medium,https://react.dev/reference/react/useOptimistic,react 19.2.x,active,2026-09-21
|
|
67
|
+
66,Forms,Use form actions for Action-based submissions,Passing a function to action runs it in a Transition; Server Functions can progressively enhance forms.,Use a Server Function with useActionState when submission must work before hydration,Claim progressive enhancement for a client-only action,<form action={serverAction}>...</form>,<form action={clientAction}>...</form> // requires JavaScript,Medium,https://react.dev/reference/react-dom/components/form,react 19.2.x,active,2026-09-21
|
|
@@ -1,61 +1,69 @@
|
|
|
1
|
-
No,Category,Guideline,Description,Do,Don't,Code Good,Code Bad,Severity,Docs URL
|
|
2
|
-
1,Setup,Use CLI for installation,
|
|
3
|
-
2,Setup,Initialize project properly,Run init command to set up components.json and globals.css,npx shadcn@latest init before adding components,Skip init and add components directly,npx shadcn@latest init,npx shadcn@latest add button (without init),High,https://ui.shadcn.com/docs/installation
|
|
4
|
-
3,Setup,Configure path aliases,Set up proper import aliases in tsconfig and components.json,Use @/components/ui path aliases,Relative imports like ../../components,import { Button } from "@/components/ui/button",import { Button } from "../../components/ui/button",Medium,https://ui.shadcn.com/docs/installation
|
|
5
|
-
4,Theming,Use CSS variables for colors,Define
|
|
6
|
-
5,Theming,Follow
|
|
7
|
-
6,Theming,Support dark mode,
|
|
8
|
-
7,Components,Use component variants,Leverage cva variants for consistent styling,Use variant prop for different styles,Inline conditional classes
|
|
9
|
-
8,Components,Compose with className,Add custom classes via className prop for overrides,Extend with className for one-off customizations,Modify component source directly
|
|
10
|
-
9,Components,Use size variants consistently,Apply size prop for consistent sizing across components,size="sm" size="lg" for sizing,Mix size classes inconsistently
|
|
11
|
-
10,Components,Prefer compound components,Use provided sub-components for complex UI,Card + CardHeader + CardContent pattern,Single component with many props,<Card><CardHeader><CardTitle
|
|
12
|
-
11,Dialog,Use Dialog for modal content,Dialog component for overlay modal windows,Dialog for confirmations forms details,Alert for modal content,<Dialog><DialogContent>,<Alert> styled as modal,High,https://ui.shadcn.com/docs/components/dialog
|
|
13
|
-
12,Dialog,Handle dialog state properly,Use open and onOpenChange for controlled dialogs,Controlled state with useState,Uncontrolled with default open only
|
|
14
|
-
13,Dialog,Include proper dialog structure,Use DialogHeader DialogTitle DialogDescription,Complete semantic structure,Missing title or description,<DialogHeader><DialogTitle><DialogDescription>,<DialogContent><p>Content</p></DialogContent>,High,https://ui.shadcn.com/docs/components/dialog
|
|
15
|
-
14,Sheet,Use Sheet for side panels,Sheet component for slide-out panels and drawers,Sheet for navigation filters settings,Dialog for side content
|
|
16
|
-
15,Sheet,Specify sheet side,Set side prop for sheet slide direction,Explicit side="left" or side="right",Default side without consideration
|
|
17
|
-
16,Form,
|
|
18
|
-
17,Form,Use
|
|
19
|
-
18,Form,Display
|
|
20
|
-
19,Form,Use
|
|
21
|
-
20,Select,Use Select for dropdowns,Select component for option selection,Select for choosing from list,Native select element,<Select><SelectTrigger><SelectContent>,<select><option>,Medium,https://ui.shadcn.com/docs/components/select
|
|
22
|
-
21,Select,Structure Select properly,Include Trigger Value Content and Items,Complete Select structure,Missing SelectValue or SelectContent,<SelectTrigger><SelectValue/></SelectTrigger><SelectContent><SelectItem>,<Select><option>,High,https://ui.shadcn.com/docs/components/select
|
|
23
|
-
22,Command,Use Command for search,Command component for searchable lists and palettes,Command for command palette search,Input with custom dropdown,<Command><CommandInput><CommandList
|
|
24
|
-
23,Command,Group command items,Use CommandGroup for categorized items,CommandGroup with heading for sections,Flat list without grouping
|
|
25
|
-
24,Table,Use Table for data display,Table component for structured data,Table for tabular data display,Div grid for table-like layouts,<Table><TableHeader><TableBody><TableRow
|
|
26
|
-
25,Table,Include proper table structure,Use TableHeader TableBody TableRow TableCell,Semantic table structure,Missing thead or tbody,<TableHeader><TableRow><TableHead>,<Table><TableRow> without header,High,https://ui.shadcn.com/docs/components/table
|
|
27
|
-
26,DataTable,Use DataTable for complex tables,Combine Table with TanStack Table for features,DataTable pattern for sorting filtering pagination,Custom table implementation,useReactTable + Table components,Custom sort filter pagination logic,Medium,https://ui.shadcn.com/docs/components/data-table
|
|
28
|
-
27,Tabs,Use Tabs for content switching,Tabs component for tabbed interfaces,Tabs for related content sections,Custom tab implementation,<Tabs><TabsList><TabsTrigger><TabsContent>,<div onClick={() => setTab(...)},Medium,https://ui.shadcn.com/docs/components/tabs
|
|
29
|
-
28,Tabs,Set default tab value,Specify defaultValue for initial tab,defaultValue on Tabs component,No default leaving first tab
|
|
30
|
-
29,Accordion,Use Accordion for collapsible,Accordion for expandable content sections,Accordion for FAQ settings panels,Custom collapse implementation,<Accordion><AccordionItem><AccordionTrigger>,<div onClick={() => setOpen(!open)}>,Medium,https://ui.shadcn.com/docs/components/accordion
|
|
31
|
-
30,Accordion,Choose accordion type,Use type="single" or type="multiple" appropriately,type="single" for one open type="multiple" for many,Default type without consideration
|
|
32
|
-
31,Toast,Use Sonner for toasts,Sonner integration for toast notifications,toast() from sonner for notifications,Custom toast implementation,toast("Event created"),setShowToast(true),Medium,https://ui.shadcn.com/docs/components/sonner
|
|
33
|
-
32,Toast,Add Toaster to layout,Include Toaster component in root layout,<Toaster /> in app layout,Toaster in individual pages,app/layout.tsx: <Toaster />,page.tsx: <Toaster />,High,https://ui.shadcn.com/docs/components/sonner
|
|
34
|
-
33,Toast,Use toast variants,Apply toast.success toast.error for context,Semantic toast methods,Generic toast for all messages,toast.success("Saved!") toast.error("Failed"),toast("Saved!") toast("Failed"),Medium,https://ui.shadcn.com/docs/components/sonner
|
|
35
|
-
34,Popover,Use Popover for floating content,Popover for dropdown menus and floating panels,Popover for contextual actions,Absolute positioned divs,<Popover><PopoverTrigger><PopoverContent
|
|
36
|
-
35,Popover,Handle popover alignment,Use align and side props for positioning,Explicit alignment configuration,Default alignment for all
|
|
37
|
-
36,DropdownMenu,Use DropdownMenu for actions,DropdownMenu for action lists and context menus,DropdownMenu for user menu actions,Popover for action lists,<DropdownMenu><DropdownMenuTrigger><DropdownMenuContent>,<Popover> for menu actions,Medium,https://ui.shadcn.com/docs/components/dropdown-menu
|
|
38
|
-
37,DropdownMenu,Group menu items,Use DropdownMenuGroup and DropdownMenuSeparator,Organized menu with separators,Flat list of items,<DropdownMenuGroup><DropdownMenuItem><DropdownMenuSeparator>,<DropdownMenuItem> without organization,Low,https://ui.shadcn.com/docs/components/dropdown-menu
|
|
39
|
-
38,Tooltip,Use Tooltip for hints,Tooltip for icon buttons and truncated text,Tooltip for additional context,Title attribute for tooltips,<Tooltip><TooltipTrigger><TooltipContent
|
|
40
|
-
39,Tooltip,Add TooltipProvider,Wrap app or section in TooltipProvider,TooltipProvider at app level,TooltipProvider per tooltip,<TooltipProvider><App/></TooltipProvider>,<Tooltip><TooltipProvider>,High,https://ui.shadcn.com/docs/components/tooltip
|
|
41
|
-
40,Skeleton,Use Skeleton for loading,Skeleton component for loading placeholders,Skeleton matching content layout,Spinner for content loading
|
|
42
|
-
41,Skeleton,Match skeleton dimensions,Size skeleton to match loaded content,Skeleton same size as expected content,Generic skeleton size
|
|
43
|
-
42,AlertDialog,Use AlertDialog for confirms,AlertDialog for destructive action confirmation,AlertDialog for delete confirmations,Dialog for confirmations,<AlertDialog><AlertDialogTrigger><AlertDialogContent>,<Dialog> for delete confirmation,High,https://ui.shadcn.com/docs/components/alert-dialog
|
|
44
|
-
43,AlertDialog,Include action buttons,Use AlertDialogAction and AlertDialogCancel,Standard confirm/cancel pattern,Custom buttons in AlertDialog,<AlertDialogCancel>Cancel</AlertDialogCancel><AlertDialogAction>,<Button>Cancel</Button><Button>Confirm</Button>,Medium,https://ui.shadcn.com/docs/components/alert-dialog
|
|
45
|
-
44,Sidebar,Use Sidebar for navigation,Sidebar component for app navigation,Sidebar for main app navigation,Custom sidebar implementation,<SidebarProvider><Sidebar><SidebarContent
|
|
46
|
-
45,Sidebar,Wrap in SidebarProvider,Use SidebarProvider for sidebar state management,SidebarProvider at layout level,Sidebar without provider,<SidebarProvider><Sidebar></SidebarProvider>,<Sidebar> without provider,High,https://ui.shadcn.com/docs/components/sidebar
|
|
47
|
-
46,Sidebar,Use SidebarTrigger,Include SidebarTrigger for mobile toggle,SidebarTrigger for responsive toggle,Custom toggle button,<SidebarTrigger/>,<Button onClick={() => toggleSidebar()}>,Medium,https://ui.shadcn.com/docs/components/sidebar
|
|
48
|
-
47,Chart,Use Chart for data viz,Chart component with Recharts integration,Chart component for dashboards,Direct Recharts without wrapper,<ChartContainer config={chartConfig}>,<ResponsiveContainer><BarChart>,Medium,https://ui.shadcn.com/docs/components/chart
|
|
49
|
-
48,Chart,Define chart config,Create chartConfig for consistent theming,chartConfig with color definitions,Inline colors in charts,"{ desktop: { label: ""Desktop"", color: ""#2563eb"" } }"
|
|
50
|
-
49,Chart,Use ChartTooltip,Apply ChartTooltip for interactive charts,ChartTooltip with ChartTooltipContent,Recharts Tooltip directly,<ChartTooltip content={<ChartTooltipContent/>}/>,<Tooltip/> from recharts,Low,https://ui.shadcn.com/docs/components/chart
|
|
51
|
-
50,Blocks,Use blocks for scaffolding,Start from shadcn blocks for common layouts,npx shadcn@latest add dashboard-01,Build dashboard from scratch,npx shadcn@latest add login-01,Custom login page from scratch,Medium,https://ui.shadcn.com/blocks
|
|
52
|
-
51,Blocks,Customize block components,Modify copied block code to fit needs,Edit block files after installation,Use blocks without modification,Customize dashboard-01 layout,Use dashboard-01 as-is,Low,https://ui.shadcn.com/blocks
|
|
53
|
-
52,A11y,Use semantic components,Shadcn components have built-in ARIA,Rely on component accessibility,Override ARIA attributes,<Button> has button role
|
|
54
|
-
53,A11y,Maintain focus management,Dialog Sheet handle focus automatically,Let components manage focus,Custom focus handling,<Dialog> traps focus,document.querySelector().focus(),High,https://ui.shadcn.com/docs/components/dialog
|
|
55
|
-
54,A11y,Provide labels,Use
|
|
56
|
-
55,Performance,Import components individually,Import only needed components,Named imports from component files,Import all from index,import { Button } from "@/components/ui/button",import { Button Card Dialog } from "@/components/ui",Medium,
|
|
57
|
-
56,Performance,Lazy load dialogs,Dynamic import for heavy dialog content,React.lazy for dialog content,Import all dialogs upfront,const HeavyContent = lazy(() => import('./Heavy')),import HeavyContent from './Heavy',Medium,
|
|
58
|
-
57,Customization,Extend variants with cva,Add new variants using class-variance-authority,Extend buttonVariants for new styles,Inline classes for variants,"variants: { size: { xl: ""h-14 px-8"" } }",className="h-14 px-8",Medium,https://ui.shadcn.com/docs/components/button
|
|
59
|
-
58,Customization,Create custom components,Build new components following shadcn patterns,Use cn() and cva for custom components,Different patterns for custom,const Custom = ({ className }) => <div className={cn("base" className)}
|
|
60
|
-
59,Patterns,Use asChild for composition,asChild
|
|
61
|
-
60,
|
|
1
|
+
No,Category,Guideline,Description,Do,Don't,Code Good,Code Bad,Severity,Docs URL,Applies To,Status,Verified At
|
|
2
|
+
1,Setup,Use CLI for installation,Use CLI v4 to resolve the selected base dependencies and registry items,npx shadcn@latest add component-name,Bypass CLI resolution with stale copied code,npx shadcn@latest add button,Copy an old component implementation,High,https://ui.shadcn.com/docs/cli,shadcn cli 4; base=base|radix|aria,active,2026-08-13
|
|
3
|
+
2,Setup,Initialize project properly,Run init command to set up components.json and globals.css,npx shadcn@latest init before adding components,Skip init and add components directly,npx shadcn@latest init,npx shadcn@latest add button (without init),High,https://ui.shadcn.com/docs/installation,shadcn cli 4; base=base|radix|aria,active,2026-08-13
|
|
4
|
+
3,Setup,Configure path aliases,Set up proper import aliases in tsconfig and components.json,Use @/components/ui path aliases,Relative imports like ../../components,"import { Button } from ""@/components/ui/button""","import { Button } from ""../../components/ui/button""",Medium,https://ui.shadcn.com/docs/installation,shadcn cli 4; base=base|radix|aria,active,2026-08-13
|
|
5
|
+
4,Theming,Use CSS variables for colors,Define semantic OKLCH variables in globals.css and expose them to Tailwind v4 with @theme inline,:root and .dark variables plus @theme inline mappings,Hardcode palette colors in components,"@theme inline { --color-primary: var(--primary); }",bg-blue-500 text-white,High,https://ui.shadcn.com/docs/theming,shadcn cli 4; base=base|radix|aria,active,2026-08-13
|
|
6
|
+
5,Theming,Follow semantic color pairs,Pair each semantic surface token with its foreground token,primary and primary-foreground; secondary and secondary-foreground,Use generic visual names that hide intent,--primary and --primary-foreground,--blue and --light-blue,Medium,https://ui.shadcn.com/docs/theming,shadcn cli 4; base=base|radix|aria,active,2026-08-13
|
|
7
|
+
6,Theming,Support dark mode,Override semantic OKLCH variables under .dark for every custom theme token,Define complete :root and .dark semantic schemes,Keep legacy space-separated HSL snippets or omit dark tokens,.dark { --background: oklch(0.145 0 0); },.dark { --background: 240 10% 3.9%; },High,https://ui.shadcn.com/docs/dark-mode,shadcn cli 4; base=base|radix|aria,active,2026-08-13
|
|
8
|
+
7,Components,Use component variants,Leverage cva variants for consistent styling,Use variant prop for different styles,Inline conditional classes,"<Button variant=""destructive"">","<Button className={isError ? ""bg-red-500"" : ""bg-blue-500""}>",Medium,https://ui.shadcn.com/docs/components/button,shadcn cli 4; base=base|radix|aria,active,2026-08-13
|
|
9
|
+
8,Components,Compose with className,Add custom classes via className prop for overrides,Extend with className for one-off customizations,Modify component source directly,"<Button className=""w-full"">",Edit button.tsx to add w-full,Medium,https://ui.shadcn.com/docs/components/button,shadcn cli 4; base=base|radix|aria,active,2026-08-13
|
|
10
|
+
9,Components,Use size variants consistently,Apply size prop for consistent sizing across components,"size=""sm"" size=""lg"" for sizing",Mix size classes inconsistently,"<Button size=""lg"">","<Button className=""text-lg px-8 py-4"">",Medium,https://ui.shadcn.com/docs/components/button,shadcn cli 4; base=base|radix|aria,active,2026-08-13
|
|
11
|
+
10,Components,Prefer compound components,Use provided sub-components for complex UI,Card + CardHeader + CardContent pattern,Single component with many props,<Card><CardHeader><CardTitle>,"<Card title=""x"" content=""y"" footer=""z"">",Medium,https://ui.shadcn.com/docs/components/card,shadcn cli 4; base=base|radix|aria,active,2026-08-13
|
|
12
|
+
11,Dialog,Use Dialog for modal content,Dialog component for overlay modal windows,Dialog for confirmations forms details,Alert for modal content,<Dialog><DialogContent>,<Alert> styled as modal,High,https://ui.shadcn.com/docs/components/dialog,shadcn cli 4; base=base|radix|aria,active,2026-08-13
|
|
13
|
+
12,Dialog,Handle dialog state properly,Use open and onOpenChange for controlled dialogs,Controlled state with useState,Uncontrolled with default open only,<Dialog open={open} onOpenChange={setOpen}>,<Dialog defaultOpen={true}>,Medium,https://ui.shadcn.com/docs/components/dialog,shadcn cli 4; base=base|radix|aria,active,2026-08-13
|
|
14
|
+
13,Dialog,Include proper dialog structure,Use DialogHeader DialogTitle DialogDescription,Complete semantic structure,Missing title or description,<DialogHeader><DialogTitle><DialogDescription>,<DialogContent><p>Content</p></DialogContent>,High,https://ui.shadcn.com/docs/components/dialog,shadcn cli 4; base=base|radix|aria,active,2026-08-13
|
|
15
|
+
14,Sheet,Use Sheet for side panels,Sheet component for slide-out panels and drawers,Sheet for navigation filters settings,Dialog for side content,"<Sheet side=""right"">",<Dialog> with slide animation,Medium,https://ui.shadcn.com/docs/components/sheet,shadcn cli 4; base=base|radix|aria,active,2026-08-13
|
|
16
|
+
15,Sheet,Specify sheet side,Set side prop for sheet slide direction,"Explicit side=""left"" or side=""right""",Default side without consideration,"<Sheet><SheetContent side=""left"">",<Sheet><SheetContent>,Low,https://ui.shadcn.com/docs/components/sheet,shadcn cli 4; base=base|radix|aria,active,2026-08-13
|
|
17
|
+
16,Form,React Hook Form integration,Use a native form with React Hook Form Controller and shadcn Field primitives,useForm + Controller + Field,Depend on the retired FormField-only abstraction,<Controller render={({ field }) => <Field><Input {...field}/></Field>}/>,<FormField control={form.control}>,High,https://ui.shadcn.com/docs/forms/react-hook-form,shadcn cli 4; base=base|radix|aria,active,2026-08-13
|
|
18
|
+
17,Form,Use Field for input structure,Compose Field Label and Control for accessible form structure,Field + FieldLabel + Input,Unlabeled input or stale FormItem wrapper,<Field><FieldLabel htmlFor='email'>Email</FieldLabel><Input id='email'/></Field>,<Input placeholder='Email'/>,High,https://ui.shadcn.com/docs/components/field,shadcn cli 4; base=base|radix|aria,active,2026-08-13
|
|
19
|
+
18,Form,Display field errors,Render validation messages with FieldError,FieldError with controller fieldState errors,Unassociated custom error text,<FieldError errors={[fieldState.error]}/>,<span>{error.message}</span>,Medium,https://ui.shadcn.com/docs/components/field,shadcn cli 4; base=base|radix|aria,active,2026-08-13
|
|
20
|
+
19,Form,Use schema validation,Use a Standard Schema compatible validator such as Zod where it adds value,Zod schema with resolver or form adapter,Assume Zod is the only supported validator,zodResolver(formSchema),Hand-written divergent client rules,Medium,https://ui.shadcn.com/docs/forms,shadcn cli 4; base=base|radix|aria,active,2026-08-13
|
|
21
|
+
20,Select,Use Select for dropdowns,Select component for option selection,Select for choosing from list,Native select element,<Select><SelectTrigger><SelectContent>,<select><option>,Medium,https://ui.shadcn.com/docs/components/select,shadcn cli 4; base=base|radix|aria,active,2026-08-13
|
|
22
|
+
21,Select,Structure Select properly,Include Trigger Value Content and Items,Complete Select structure,Missing SelectValue or SelectContent,<SelectTrigger><SelectValue/></SelectTrigger><SelectContent><SelectItem>,<Select><option>,High,https://ui.shadcn.com/docs/components/select,shadcn cli 4; base=base|radix|aria,active,2026-08-13
|
|
23
|
+
22,Command,Use Command for search,Command component for searchable lists and palettes,Command for command palette search,Input with custom dropdown,<Command><CommandInput><CommandList>,"<Input><div className=""dropdown"">",Medium,https://ui.shadcn.com/docs/components/command,shadcn cli 4; base=base|radix|aria,active,2026-08-13
|
|
24
|
+
23,Command,Group command items,Use CommandGroup for categorized items,CommandGroup with heading for sections,Flat list without grouping,"<CommandGroup heading=""Suggestions""><CommandItem>",<CommandItem> without groups,Low,https://ui.shadcn.com/docs/components/command,shadcn cli 4; base=base|radix|aria,active,2026-08-13
|
|
25
|
+
24,Table,Use Table for data display,Table component for structured data,Table for tabular data display,Div grid for table-like layouts,<Table><TableHeader><TableBody><TableRow>,"<div className=""grid"">",Medium,https://ui.shadcn.com/docs/components/table,shadcn cli 4; base=base|radix|aria,active,2026-08-13
|
|
26
|
+
25,Table,Include proper table structure,Use TableHeader TableBody TableRow TableCell,Semantic table structure,Missing thead or tbody,<TableHeader><TableRow><TableHead>,<Table><TableRow> without header,High,https://ui.shadcn.com/docs/components/table,shadcn cli 4; base=base|radix|aria,active,2026-08-13
|
|
27
|
+
26,DataTable,Use DataTable for complex tables,Combine Table with TanStack Table for features,DataTable pattern for sorting filtering pagination,Custom table implementation,useReactTable + Table components,Custom sort filter pagination logic,Medium,https://ui.shadcn.com/docs/components/data-table,shadcn cli 4; base=base|radix|aria,active,2026-08-13
|
|
28
|
+
27,Tabs,Use Tabs for content switching,Tabs component for tabbed interfaces,Tabs for related content sections,Custom tab implementation,<Tabs><TabsList><TabsTrigger><TabsContent>,<div onClick={() => setTab(...)},Medium,https://ui.shadcn.com/docs/components/tabs,shadcn cli 4; base=base|radix|aria,active,2026-08-13
|
|
29
|
+
28,Tabs,Set default tab value,Specify defaultValue for initial tab,defaultValue on Tabs component,No default leaving first tab,"<Tabs defaultValue=""account"">",<Tabs> without defaultValue,Low,https://ui.shadcn.com/docs/components/tabs,shadcn cli 4; base=base|radix|aria,active,2026-08-13
|
|
30
|
+
29,Accordion,Use Accordion for collapsible,Accordion for expandable content sections,Accordion for FAQ settings panels,Custom collapse implementation,<Accordion><AccordionItem><AccordionTrigger>,<div onClick={() => setOpen(!open)}>,Medium,https://ui.shadcn.com/docs/components/accordion,shadcn cli 4; base=base|radix|aria,active,2026-08-13
|
|
31
|
+
30,Accordion,Choose accordion type,"Use type=""single"" or type=""multiple"" appropriately","type=""single"" for one open type=""multiple"" for many",Default type without consideration,"<Accordion type=""single"" collapsible>",<Accordion> without type,Low,https://ui.shadcn.com/docs/components/accordion,shadcn cli 4; base=base|radix|aria,active,2026-08-13
|
|
32
|
+
31,Toast,Use Sonner for toasts,Sonner integration for toast notifications,toast() from sonner for notifications,Custom toast implementation,"toast(""Event created"")",setShowToast(true),Medium,https://ui.shadcn.com/docs/components/sonner,shadcn cli 4; base=base|radix|aria,active,2026-08-13
|
|
33
|
+
32,Toast,Add Toaster to layout,Include Toaster component in root layout,<Toaster /> in app layout,Toaster in individual pages,app/layout.tsx: <Toaster />,page.tsx: <Toaster />,High,https://ui.shadcn.com/docs/components/sonner,shadcn cli 4; base=base|radix|aria,active,2026-08-13
|
|
34
|
+
33,Toast,Use toast variants,Apply toast.success toast.error for context,Semantic toast methods,Generic toast for all messages,"toast.success(""Saved!"") toast.error(""Failed"")","toast(""Saved!"") toast(""Failed"")",Medium,https://ui.shadcn.com/docs/components/sonner,shadcn cli 4; base=base|radix|aria,active,2026-08-13
|
|
35
|
+
34,Popover,Use Popover for floating content,Popover for dropdown menus and floating panels,Popover for contextual actions,Absolute positioned divs,<Popover><PopoverTrigger><PopoverContent>,"<div className=""relative""><div className=""absolute"">",Medium,https://ui.shadcn.com/docs/components/popover,shadcn cli 4; base=base|radix|aria,active,2026-08-13
|
|
36
|
+
35,Popover,Handle popover alignment,Use align and side props for positioning,Explicit alignment configuration,Default alignment for all,"<PopoverContent align=""start"" side=""bottom"">",<PopoverContent>,Low,https://ui.shadcn.com/docs/components/popover,shadcn cli 4; base=base|radix|aria,active,2026-08-13
|
|
37
|
+
36,DropdownMenu,Use DropdownMenu for actions,DropdownMenu for action lists and context menus,DropdownMenu for user menu actions,Popover for action lists,<DropdownMenu><DropdownMenuTrigger><DropdownMenuContent>,<Popover> for menu actions,Medium,https://ui.shadcn.com/docs/components/dropdown-menu,shadcn cli 4; base=base|radix|aria,active,2026-08-13
|
|
38
|
+
37,DropdownMenu,Group menu items,Use DropdownMenuGroup and DropdownMenuSeparator,Organized menu with separators,Flat list of items,<DropdownMenuGroup><DropdownMenuItem><DropdownMenuSeparator>,<DropdownMenuItem> without organization,Low,https://ui.shadcn.com/docs/components/dropdown-menu,shadcn cli 4; base=base|radix|aria,active,2026-08-13
|
|
39
|
+
38,Tooltip,Use Tooltip for hints,Tooltip for icon buttons and truncated text,Tooltip for additional context,Title attribute for tooltips,<Tooltip><TooltipTrigger><TooltipContent>,"<button title=""Delete"">",Medium,https://ui.shadcn.com/docs/components/tooltip,shadcn cli 4; base=base|radix|aria,active,2026-08-13
|
|
40
|
+
39,Tooltip,Add TooltipProvider,Wrap app or section in TooltipProvider,TooltipProvider at app level,TooltipProvider per tooltip,<TooltipProvider><App/></TooltipProvider>,<Tooltip><TooltipProvider>,High,https://ui.shadcn.com/docs/components/tooltip,shadcn cli 4; base=base|radix|aria,active,2026-08-13
|
|
41
|
+
40,Skeleton,Use Skeleton for loading,Skeleton component for loading placeholders,Skeleton matching content layout,Spinner for content loading,"<Skeleton className=""h-4 w-[200px]""/>",<Spinner/> for card loading,Medium,https://ui.shadcn.com/docs/components/skeleton,shadcn cli 4; base=base|radix|aria,active,2026-08-13
|
|
42
|
+
41,Skeleton,Match skeleton dimensions,Size skeleton to match loaded content,Skeleton same size as expected content,Generic skeleton size,"<Skeleton className=""h-12 w-12 rounded-full""/>",<Skeleton/> without sizing,Medium,https://ui.shadcn.com/docs/components/skeleton,shadcn cli 4; base=base|radix|aria,active,2026-08-13
|
|
43
|
+
42,AlertDialog,Use AlertDialog for confirms,AlertDialog for destructive action confirmation,AlertDialog for delete confirmations,Dialog for confirmations,<AlertDialog><AlertDialogTrigger><AlertDialogContent>,<Dialog> for delete confirmation,High,https://ui.shadcn.com/docs/components/alert-dialog,shadcn cli 4; base=base|radix|aria,active,2026-08-13
|
|
44
|
+
43,AlertDialog,Include action buttons,Use AlertDialogAction and AlertDialogCancel,Standard confirm/cancel pattern,Custom buttons in AlertDialog,<AlertDialogCancel>Cancel</AlertDialogCancel><AlertDialogAction>,<Button>Cancel</Button><Button>Confirm</Button>,Medium,https://ui.shadcn.com/docs/components/alert-dialog,shadcn cli 4; base=base|radix|aria,active,2026-08-13
|
|
45
|
+
44,Sidebar,Use Sidebar for navigation,Sidebar component for app navigation,Sidebar for main app navigation,Custom sidebar implementation,<SidebarProvider><Sidebar><SidebarContent>,"<div className=""w-64 fixed"">",Medium,https://ui.shadcn.com/docs/components/sidebar,shadcn cli 4; base=base|radix|aria,active,2026-08-13
|
|
46
|
+
45,Sidebar,Wrap in SidebarProvider,Use SidebarProvider for sidebar state management,SidebarProvider at layout level,Sidebar without provider,<SidebarProvider><Sidebar></SidebarProvider>,<Sidebar> without provider,High,https://ui.shadcn.com/docs/components/sidebar,shadcn cli 4; base=base|radix|aria,active,2026-08-13
|
|
47
|
+
46,Sidebar,Use SidebarTrigger,Include SidebarTrigger for mobile toggle,SidebarTrigger for responsive toggle,Custom toggle button,<SidebarTrigger/>,<Button onClick={() => toggleSidebar()}>,Medium,https://ui.shadcn.com/docs/components/sidebar,shadcn cli 4; base=base|radix|aria,active,2026-08-13
|
|
48
|
+
47,Chart,Use Chart for data viz,Chart component with Recharts integration,Chart component for dashboards,Direct Recharts without wrapper,<ChartContainer config={chartConfig}>,<ResponsiveContainer><BarChart>,Medium,https://ui.shadcn.com/docs/components/chart,shadcn cli 4; base=base|radix|aria,active,2026-08-13
|
|
49
|
+
48,Chart,Define chart config,Create chartConfig for consistent theming,chartConfig with color definitions,Inline colors in charts,"{ desktop: { label: ""Desktop"", color: ""#2563eb"" } }","<Bar fill=""#2563eb""/>",Medium,https://ui.shadcn.com/docs/components/chart,shadcn cli 4; base=base|radix|aria,active,2026-08-13
|
|
50
|
+
49,Chart,Use ChartTooltip,Apply ChartTooltip for interactive charts,ChartTooltip with ChartTooltipContent,Recharts Tooltip directly,<ChartTooltip content={<ChartTooltipContent/>}/>,<Tooltip/> from recharts,Low,https://ui.shadcn.com/docs/components/chart,shadcn cli 4; base=base|radix|aria,active,2026-08-13
|
|
51
|
+
50,Blocks,Use blocks for scaffolding,Start from shadcn blocks for common layouts,npx shadcn@latest add dashboard-01,Build dashboard from scratch,npx shadcn@latest add login-01,Custom login page from scratch,Medium,https://ui.shadcn.com/blocks,shadcn cli 4; base=base|radix|aria,active,2026-08-13
|
|
52
|
+
51,Blocks,Customize block components,Modify copied block code to fit needs,Edit block files after installation,Use blocks without modification,Customize dashboard-01 layout,Use dashboard-01 as-is,Low,https://ui.shadcn.com/blocks,shadcn cli 4; base=base|radix|aria,active,2026-08-13
|
|
53
|
+
52,A11y,Use semantic components,Shadcn components have built-in ARIA,Rely on component accessibility,Override ARIA attributes,<Button> has button role,"<div role=""button"">",High,https://ui.shadcn.com/docs/components/button,shadcn cli 4; base=base|radix|aria,active,2026-08-13
|
|
54
|
+
53,A11y,Maintain focus management,Dialog Sheet handle focus automatically,Let components manage focus,Custom focus handling,<Dialog> traps focus,document.querySelector().focus(),High,https://ui.shadcn.com/docs/components/dialog,shadcn cli 4; base=base|radix|aria,active,2026-08-13
|
|
55
|
+
54,A11y,Provide labels,Use FieldLabel or an explicit accessible name,Associate visible labels with form controls,Placeholder as only label,<FieldLabel htmlFor='email'>Email</FieldLabel><Input id='email'/>,"<Input placeholder=""Email""/>",High,https://ui.shadcn.com/docs/components/field,shadcn cli 4; base=base|radix|aria,active,2026-08-13
|
|
56
|
+
55,Performance,Import components individually,Import only needed components,Named imports from component files,Import all from index,"import { Button } from ""@/components/ui/button""","import { Button Card Dialog } from ""@/components/ui""",Medium,,shadcn cli 4; base=base|radix|aria,active,2026-08-13
|
|
57
|
+
56,Performance,Lazy load dialogs,Dynamic import for heavy dialog content,React.lazy for dialog content,Import all dialogs upfront,const HeavyContent = lazy(() => import('./Heavy')),import HeavyContent from './Heavy',Medium,,shadcn cli 4; base=base|radix|aria,active,2026-08-13
|
|
58
|
+
57,Customization,Extend variants with cva,Add new variants using class-variance-authority,Extend buttonVariants for new styles,Inline classes for variants,"variants: { size: { xl: ""h-14 px-8"" } }","className=""h-14 px-8""",Medium,https://ui.shadcn.com/docs/components/button,shadcn cli 4; base=base|radix|aria,active,2026-08-13
|
|
59
|
+
58,Customization,Create custom components,Build new components following shadcn patterns,Use cn() and cva for custom components,Different patterns for custom,"const Custom = ({ className }) => <div className={cn(""base"" className)}>",const Custom = ({ style }) => <div style={style}>,Medium,,shadcn cli 4; base=base|radix|aria,active,2026-08-13
|
|
60
|
+
59,Patterns,Use asChild for Radix composition,Radix-based components support asChild for polymorphic composition,Use asChild only when the installed Radix component exposes it,Assume Base UI or React Aria components share the Radix API,"<Button asChild><Link href=""/"">","<Button><Link href=""/""></Link></Button>",Medium,https://ui.shadcn.com/docs/components/radix/button,shadcn cli 4; base=radix,active,2026-08-13
|
|
61
|
+
60,Form,TanStack Form integration,Use TanStack Form field adapters with shadcn Field primitives when that form library is selected,form.Field + Field + FieldError,Apply React Hook Form Controller APIs to TanStack Form,<form.Field name='email'>{field => <Field><Input value={field.state.value}/></Field>}</form.Field>,<Controller control={form.control}/>,High,https://ui.shadcn.com/docs/forms/tanstack-form,shadcn cli 4; base=base|radix|aria,active,2026-08-13
|
|
62
|
+
61,Setup,Select an explicit component base,CLI v4 supports base radix and aria; Base UI is the new-project default while existing projects retain their base,Pin --base in non-interactive automation,Infer that an existing Radix project must migrate,npx shadcn@latest init --base aria,Assume every base supports asChild,High,https://ui.shadcn.com/docs/cli#init,shadcn cli 4; base=base|radix|aria,active,2026-08-13
|
|
63
|
+
62,Registry,Use base and font registry item types,Publish base primitives as registry:base and fonts as registry:font so CLI v4 applies them correctly,Explicit registry item types,Publish every artifact as registry:ui,"type: 'registry:base' or type: 'registry:font'","type: 'registry:ui' for a base definition",Medium,https://ui.shadcn.com/docs/registry/registry-item-json,shadcn cli 4; base=base|radix|aria,active,2026-08-13
|
|
64
|
+
63,Registry,Inspect CLI changes before writing,Use CLI v4 dry-run diff and view plus info and docs to inspect project and registry state,npx shadcn@latest add button --dry-run,Blindly overwrite customized components,npx shadcn@latest add button --diff,npx shadcn@latest add button without review,High,https://ui.shadcn.com/docs/cli#add,shadcn cli 4; base=base|radix|aria,active,2026-08-13
|
|
65
|
+
64,Registry,Install public GitHub registries directly,A public repository with root registry.json can be addressed as owner/repo/item,npx shadcn@latest add owner/repo/item,Require a separately hosted generated registry,npx shadcn@latest add acme/ui/button,Copy raw GitHub source files,Medium,https://ui.shadcn.com/docs/registry/getting-started,shadcn cli 4; base=base|radix|aria,active,2026-08-13
|
|
66
|
+
65,Setup,Use CLI presets and apply workflows,Use CLI v4 preset and apply for repeatable project configuration,npx shadcn@latest preset then apply,Manually reproduce a saved project setup,npx shadcn@latest apply <preset>,Copy configuration by hand,Medium,https://ui.shadcn.com/docs/cli,shadcn cli 4; base=base|radix|aria,active,2026-08-13
|
|
67
|
+
66,Registry,Keep registry source declarations,Configure namespaced registry URLs and required headers in components.json,Use registries map with environment variables,Hardcode private registry secrets in source,"registries: { '@acme': { url: '${REGISTRY_URL}/{name}.json' } }",Commit bearer tokens,High,https://ui.shadcn.com/docs/registry/namespace,shadcn cli 4; base=base|radix|aria,active,2026-08-13
|
|
68
|
+
67,Patterns,Preserve React Aria link semantics,Style a semantic anchor with buttonVariants when navigation is intended,Use an anchor for a link and a button for an action,Render a React Aria Button that masquerades as a link,"<a href=""/docs"" className={buttonVariants()}>Docs</a>",<Button onPress={() => navigate('/docs')}>Docs</Button>,High,https://ui.shadcn.com/docs/components/aria/button,shadcn cli 4; base=aria,active,2026-08-13
|
|
69
|
+
68,Patterns,Use render for Base UI composition,Base UI components compose another element through the render prop rather than Radix asChild,Use render with the intended semantic element,Pass the Radix-only asChild prop to a Base UI component,"<Button render={<a href=""/docs"" />}>Docs</Button>","<Button asChild><a href=""/docs"">Docs</a></Button>",High,https://ui.shadcn.com/docs/components/base/button,shadcn cli 4; base=base,active,2026-08-13
|