@diffra-ai/cli 0.2.0 → 0.2.2
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 +18 -0
- package/dist/bundle/chunks/{anthropic-messages-T6QSBW2I.js → anthropic-messages-VPHYDMHB.js} +1 -1
- package/dist/bundle/chunks/{azure-openai-responses-QHACUEEL.js → azure-openai-responses-JYJ2VXQ2.js} +1 -1
- package/dist/bundle/chunks/bedrock-converse-stream.js +1 -1
- package/dist/bundle/chunks/{chunk-UVU7AFFV.js → chunk-2IABWVGX.js} +1 -1
- package/dist/bundle/chunks/{chunk-GU5QXRH2.js → chunk-6RV2XP5B.js} +10 -10
- package/dist/bundle/chunks/{chunk-ACRSTWI3.js → chunk-FCSMMPE4.js} +1 -1
- package/dist/bundle/chunks/{chunk-3OQXW6CV.js → chunk-JEYYTVUX.js} +1 -1
- package/dist/bundle/chunks/chunk-NPHITI73.js +30 -0
- package/dist/bundle/chunks/{chunk-JZ2OAQAK.js → chunk-QQYLP3HG.js} +1 -1
- package/dist/bundle/chunks/{chunk-EMYFX4WY.js → chunk-QY4GYLLA.js} +1 -1
- package/dist/bundle/chunks/{chunk-ZTDZEFOK.js → chunk-REVASUCD.js} +1 -1
- package/dist/bundle/chunks/{chunk-HGCDVLYI.js → chunk-S7OTLWTF.js} +1 -1
- package/dist/bundle/chunks/{chunk-YTFC5DOS.js → chunk-TOBZDLTR.js} +1 -1
- package/dist/bundle/chunks/{chunk-2CWIL3U7.js → chunk-Z4BBBJG4.js} +1 -1
- package/dist/bundle/chunks/{cli-B74BATSM.js → cli-I4RCHKMY.js} +1 -1
- package/dist/bundle/chunks/{cloudflare-workers-ai-system-one-IRTLSYMY.js → cloudflare-workers-ai-system-one-OTYUASP3.js} +1 -1
- package/dist/bundle/chunks/github-copilot.js +1 -1
- package/dist/bundle/chunks/{google-generative-ai-J4JVZXHV.js → google-generative-ai-DI3FOC25.js} +1 -1
- package/dist/bundle/chunks/{google-vertex-A36RXRWN.js → google-vertex-VBHHROPU.js} +1 -1
- package/dist/bundle/chunks/{llama-cpp-classify-WD5MJBC7.js → llama-cpp-classify-MUFWIFOW.js} +1 -1
- package/dist/bundle/chunks/{mistral-conversations-YIKS5LKW.js → mistral-conversations-Q2PGF352.js} +1 -1
- package/dist/bundle/chunks/{openai-codex-responses-UBNJIYCO.js → openai-codex-responses-WWZAXEPG.js} +1 -1
- package/dist/bundle/chunks/{openai-completions-WBIL7MLK.js → openai-completions-4C7QTL2T.js} +1 -1
- package/dist/bundle/chunks/{openai-decisions-6T6CQTOT.js → openai-decisions-NYOT2XIF.js} +1 -1
- package/dist/bundle/chunks/{openai-responses-W2CLKVKJ.js → openai-responses-R5MW34FB.js} +1 -1
- package/dist/bundle/chunks/{openrouter-images-ZP4QC3RD.js → openrouter-images-FBKW4PD4.js} +1 -1
- package/dist/bundle/chunks/{pi-messages-VHFVA66D.js → pi-messages-LJZPZBQY.js} +1 -1
- package/dist/bundle/chunks/{typesafe-system-one-GORHCFHB.js → typesafe-system-one-7MCWBLJY.js} +1 -1
- package/dist/bundle/chunks/{virtual-modules-XMXHVMFN.js → virtual-modules-J4Z2IMRZ.js} +1 -1
- package/dist/bundle/cli-runtime.js +1 -1
- package/dist/bundle/cli.js +0 -0
- package/dist/bundle/index.js +1 -1
- package/dist/bundle/rpc-entry.js +1 -1
- package/dist/cli.js +0 -0
- package/dist/core/agent-session.d.ts +1 -1
- package/dist/core/agent-session.d.ts.map +1 -1
- package/dist/core/agent-session.js +11 -8
- package/dist/core/agent-session.js.map +1 -1
- package/dist/core/model-resolver.js +3 -3
- package/dist/core/model-resolver.js.map +1 -1
- package/dist/extensions/skills/bundled/find-skills/LICENSE +21 -0
- package/dist/extensions/skills/bundled/find-skills/SKILL.md +117 -0
- package/dist/extensions/skills/bundled/grill-me/LICENSE +21 -0
- package/dist/extensions/skills/bundled/grill-me/SKILL.md +44 -0
- package/dist/extensions/skills/bundled/handoff/LICENSE +21 -0
- package/dist/extensions/skills/bundled/handoff/SKILL.md +31 -0
- package/dist/extensions/skills/bundled/mcp-builder/LICENSE.txt +202 -0
- package/dist/extensions/skills/bundled/mcp-builder/SKILL.md +260 -0
- package/dist/extensions/skills/bundled/mcp-builder/reference/evaluation.md +432 -0
- package/dist/extensions/skills/bundled/mcp-builder/reference/mcp_best_practices.md +249 -0
- package/dist/extensions/skills/bundled/mcp-builder/reference/node_mcp_server.md +972 -0
- package/dist/extensions/skills/bundled/mcp-builder/reference/node_mcp_server_v2.md +747 -0
- package/dist/extensions/skills/bundled/mcp-builder/reference/python_mcp_server.md +719 -0
- package/dist/extensions/skills/bundled/ui-ux-pro-max/LICENSE +21 -0
- package/dist/extensions/skills/bundled/ui-ux-pro-max/SKILL.md +251 -0
- package/dist/extensions/skills/bundled/ui-ux-pro-max/data/app-interface.csv +33 -0
- package/dist/extensions/skills/bundled/ui-ux-pro-max/data/charts.csv +26 -0
- package/dist/extensions/skills/bundled/ui-ux-pro-max/data/colors.csv +195 -0
- package/dist/extensions/skills/bundled/ui-ux-pro-max/data/google-fonts.csv +1935 -0
- package/dist/extensions/skills/bundled/ui-ux-pro-max/data/icons.csv +106 -0
- package/dist/extensions/skills/bundled/ui-ux-pro-max/data/landing.csv +35 -0
- package/dist/extensions/skills/bundled/ui-ux-pro-max/data/motion.csv +21 -0
- package/dist/extensions/skills/bundled/ui-ux-pro-max/data/products.csv +195 -0
- package/dist/extensions/skills/bundled/ui-ux-pro-max/data/react-performance.csv +45 -0
- package/dist/extensions/skills/bundled/ui-ux-pro-max/data/stacks/angular.csv +51 -0
- package/dist/extensions/skills/bundled/ui-ux-pro-max/data/stacks/astro.csv +54 -0
- package/dist/extensions/skills/bundled/ui-ux-pro-max/data/stacks/avalonia.csv +57 -0
- package/dist/extensions/skills/bundled/ui-ux-pro-max/data/stacks/flutter.csv +53 -0
- package/dist/extensions/skills/bundled/ui-ux-pro-max/data/stacks/html-tailwind.csv +60 -0
- package/dist/extensions/skills/bundled/ui-ux-pro-max/data/stacks/javafx.csv +76 -0
- package/dist/extensions/skills/bundled/ui-ux-pro-max/data/stacks/jetpack-compose.csv +53 -0
- package/dist/extensions/skills/bundled/ui-ux-pro-max/data/stacks/laravel.csv +51 -0
- package/dist/extensions/skills/bundled/ui-ux-pro-max/data/stacks/nextjs.csv +62 -0
- package/dist/extensions/skills/bundled/ui-ux-pro-max/data/stacks/nuxt-ui.csv +84 -0
- package/dist/extensions/skills/bundled/ui-ux-pro-max/data/stacks/nuxtjs.csv +68 -0
- package/dist/extensions/skills/bundled/ui-ux-pro-max/data/stacks/pyside6-qss.csv +103 -0
- package/dist/extensions/skills/bundled/ui-ux-pro-max/data/stacks/react-native.csv +52 -0
- package/dist/extensions/skills/bundled/ui-ux-pro-max/data/stacks/react.csv +67 -0
- package/dist/extensions/skills/bundled/ui-ux-pro-max/data/stacks/shadcn.csv +69 -0
- package/dist/extensions/skills/bundled/ui-ux-pro-max/data/stacks/svelte.csv +56 -0
- package/dist/extensions/skills/bundled/ui-ux-pro-max/data/stacks/swiftui.csv +51 -0
- package/dist/extensions/skills/bundled/ui-ux-pro-max/data/stacks/threejs.csv +54 -0
- package/dist/extensions/skills/bundled/ui-ux-pro-max/data/stacks/uno.csv +60 -0
- package/dist/extensions/skills/bundled/ui-ux-pro-max/data/stacks/uwp.csv +56 -0
- package/dist/extensions/skills/bundled/ui-ux-pro-max/data/stacks/vue.csv +50 -0
- package/dist/extensions/skills/bundled/ui-ux-pro-max/data/stacks/winui.csv +60 -0
- package/dist/extensions/skills/bundled/ui-ux-pro-max/data/stacks/wpf.csv +57 -0
- package/dist/extensions/skills/bundled/ui-ux-pro-max/data/styles.csv +90 -0
- package/dist/extensions/skills/bundled/ui-ux-pro-max/data/typography.csv +75 -0
- package/dist/extensions/skills/bundled/ui-ux-pro-max/data/ui-reasoning.csv +195 -0
- package/dist/extensions/skills/bundled/ui-ux-pro-max/data/ux-guidelines.csv +142 -0
- package/dist/extensions/skills/bundled/ui-ux-pro-max/references/pro-rules.md +117 -0
- package/dist/extensions/skills/bundled/ui-ux-pro-max/references/quick-reference.md +275 -0
- package/dist/extensions/skills/bundled/ui-ux-pro-max/scripts/core.py +1111 -0
- package/dist/extensions/skills/bundled/ui-ux-pro-max/scripts/design_system.py +1922 -0
- package/dist/extensions/skills/bundled/ui-ux-pro-max/scripts/preview.py +557 -0
- package/dist/extensions/skills/bundled/ui-ux-pro-max/scripts/reasoning_contract.py +123 -0
- package/dist/extensions/skills/bundled/ui-ux-pro-max/scripts/search.py +257 -0
- package/dist/extensions/skills/index.d.ts +4 -4
- package/dist/extensions/skills/index.d.ts.map +1 -1
- package/dist/extensions/skills/index.js +9 -4
- package/dist/extensions/skills/index.js.map +1 -1
- package/dist/rpc-entry.js +0 -0
- package/docs/builtin-skills.md +46 -3
- package/docs/docs.json +1 -1
- package/docs/skills.md +1 -1
- package/docs/slash-commands.md +2 -0
- package/examples/extensions/doom-overlay/doom/build/doom.wasm +0 -0
- package/examples/extensions/doom-overlay/doom/build.sh +0 -0
- package/package.json +6 -6
- package/dist/bundle/chunks/chunk-TXISM6X7.js +0 -30
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
No,Category,Guideline,Description,Do,Don't,Code Good,Code Bad,Severity,Docs URL,Applies To,Status,Verified At
|
|
2
|
+
1,Theming,Use the library theme system instead of global stylesheet overrides,qfluentwidgets ships its own QSS per widget; a global setStyleSheet on the window or a base class overwrites the library styling and breaks light/dark switching,Apply the library theme once at startup and let each component keep its own styling,Do not apply a global stylesheet that overwrites the library QSS,Call setTheme(Theme.AUTO) once at startup and let components inherit their own styles,"app = QApplication(sys.argv)
|
|
3
|
+
qconfig.set(qconfig.theme, Theme.AUTO)",High,https://qfluentwidgets.com/,pyside6-qss 6.12,active,2026-11-24
|
|
4
|
+
2,Theming,Use ThemeColor presets for accent colors,ThemeColor exposes a fixed preset set so light and dark variants stay consistent; hardcoded hex values drift from the theme,Set a ThemeColor preset and let the library derive light and dark variants,Do not hardcode accent hex values that drift away from the theme,Apply a ThemeColor preset through setThemeColor and read the accent back from the theme,"setThemeColor(ThemeColor.LIGHT_1)
|
|
5
|
+
setThemeColor(ThemeColor.DARK_1)",Medium,https://qfluentwidgets.com/,pyside6-qss 6.12,active,2026-11-24
|
|
6
|
+
3,Layout,Size content cards to their content,Adding stretch to a content card forces it to absorb leftover vertical space and produces large dead areas inside the card,Let content cards take their natural height and absorb leftover space with one trailing stretch,Do not give content cards a stretch factor,Give the card a content-driven height and let a single trailing addStretch absorb the remainder,"body.addWidget(title)
|
|
7
|
+
body.addWidget(content)
|
|
8
|
+
body.addStretch(1)",High,https://doc.qt.io/qt-6/qboxlayout.html,pyside6-qss 6.12,active,2026-11-24
|
|
9
|
+
4,Layout,Use explicit spacing instead of implicit defaults,Default Qt spacing is 6-10px which reads as cramped in a desktop utility; set spacing explicitly per container,Set spacing explicitly on every container to match the design token scale,Do not leave the implicit Qt default spacing in place,Set spacing on every container layout to match the design token scale,layout.setSpacing(16),Medium,https://doc.qt.io/qt-6/qboxlayout.html,pyside6-qss 6.12,active,2026-11-24
|
|
10
|
+
5,Layout,Set a size policy so cards keep their intended height,Without an explicit size policy a widget can grow beyond its content when placed in a stretchy layout,Set an explicit size policy so a content card keeps its intended height,Do not let cards expand vertically by default,Set QSizePolicy on content cards so they stay at content height,"card.setSizePolicy(QSizePolicy.Preferred, QSizePolicy.Maximum)",High,https://doc.qt.io/qt-6/qsizepolicy.html,pyside6-qss 6.12,active,2026-11-24
|
|
11
|
+
6,Layout,Use QSizePolicy Maximum for content-sized vertical widgets,A Maximum vertical policy lets a widget take only the space it needs while still expanding horizontally,Use an expanding horizontal and maximum vertical policy for content-sized widgets,Do not make every widget expand in both directions,"widget.setSizePolicy(QSizePolicy.Expanding, QSizePolicy.Maximum)","widget.setSizePolicy(QSizePolicy.Expanding, QSizePolicy.Expanding)",Medium,https://doc.qt.io/qt-6/qsizepolicy.html,pyside6-qss 6.12,active,2026-11-24
|
|
12
|
+
7,Animation,Use QPropertyAnimation for state transitions,Qt animations run on the UI thread event loop and drive real widget properties; hand-rolled timer interpolation drifts and repaints needlessly,Animate a concrete widget property with QPropertyAnimation,Do not hand-roll interpolation with a timer and manual repaints,Animate a concrete property such as maximumWidth opacity or pos with a QPropertyAnimation,"anim = QPropertyAnimation(self, b'maximumWidth')
|
|
13
|
+
anim.setDuration(200)
|
|
14
|
+
anim.setEasingCurve(QEasingCurve.OutCubic)
|
|
15
|
+
anim.setStartValue(0); anim.setEndValue(320); anim.start()",High,https://doc.qt.io/qt-6/qpropertyanimation.html,pyside6-qss 6.12,active,2026-11-24
|
|
16
|
+
8,Animation,Use OutCubic for entering transitions and OutQuart for numeric counters,Entering motion decelerates into place which reads as settling; a counter that eases out lands softly on the final value,Use OutCubic for entering panels and OutQuart for numeric counters,Do not use an accelerating curve for an entering transition,Use QEasingCurve.OutCubic for panels and QEasingCurve.OutQuart for counters,anim.setEasingCurve(QEasingCurve.OutCubic),Medium,https://doc.qt.io/qt-6/qeasingcurve.html,pyside6-qss 6.12,active,2026-11-24
|
|
17
|
+
9,Animation,Keep the animation object on the widget,An animation created as a local variable can be garbage collected mid-flight and silently never run,Keep the animation as an instance attribute on the widget,Do not create the animation as a throwaway local,Store the animation as an instance attribute so it lives as long as the widget,"self._expand_anim = QPropertyAnimation(self, b'maximumWidth')",High,https://doc.qt.io/qt-6/qpropertyanimation.html,pyside6-qss 6.12,active,2026-11-24
|
|
18
|
+
10,Animation,Guard against re-entrant animation triggers,A click during a running animation restarts it and produces a visible jump,Ignore a trigger while an animation is still running,Do not restart a running animation from its original start value,Use a running flag or check isFinished before starting a new animation,if self._anim.isRunning(): return,Medium,https://doc.qt.io/qt-6/qabstractanimation.html,pyside6-qss 6.12,active,2026-11-24
|
|
19
|
+
11,Animation,Never sleep on the UI thread,time.sleep in a slot freezes the event loop and makes the whole window unresponsive,Drive waiting with a QTimer or a worker thread,Do not sleep on the UI thread,Drive waiting with a QTimer or a worker thread and never block the GUI thread,"QTimer.singleShot(200, self.on_ready)",Critical,https://doc.qt.io/qt-6/qtimer.html,pyside6-qss 6.12,active,2026-11-24
|
|
20
|
+
12,Animation,Never use processEvents to fake asynchronous work,processEvents re-enters the event loop and lets handlers run mid-operation which corrupts state,Use a real QThread worker or a queued signal connection,Do not fake asynchrony with processEvents,Use a real QThread worker or a queued signal connection,worker.finished.connect(self.on_done),Critical,https://doc.qt.io/qt-6/qcoreapplication.html#processEvents,pyside6-qss 6.12,active,2026-11-24
|
|
21
|
+
13,Threading,Never touch widgets from a worker thread,Qt widgets are not thread-safe; mutating them from a worker causes crashes and undefined rendering,Emit a Signal from the worker and connect it to a slot on the widget,Do not mutate widgets from inside a worker thread,Emit a Signal from the worker and connect it to a UI slot,"class Worker(QThread):
|
|
22
|
+
done = Signal(str)
|
|
23
|
+
def run(self): self.done.emit('ok')",Critical,https://doc.qt.io/qt-6/qthread.html,pyside6-qss 6.12,active,2026-11-24
|
|
24
|
+
14,Threading,Throttle progress updates from a long scan,A scan emitting a signal per file floods the event loop and stalls the UI,Batch progress updates and emit at most every 100 ms,Do not emit one signal per scanned file,Batch progress updates and emit at most every 100 ms,"if now - self._last_emit > 100:
|
|
25
|
+
self._last_emit = now
|
|
26
|
+
self.progress.emit(count)",High,https://doc.qt.io/qt-6/qthread.html,pyside6-qss 6.12,active,2026-11-24
|
|
27
|
+
15,Threading,Use a queued connection when the worker lives in another thread,AutoConnection resolves to DirectConnection when both objects share a thread affinity which defeats the marshalling,Connect across threads with an explicit queued connection,Do not rely on AutoConnection resolving correctly across threads,Connect with Qt.QueuedConnection explicitly across threads,"self.worker.progress.connect(self.on_progress, Qt.QueuedConnection)",High,https://doc.qt.io/qt-6/signalsandslots.html,pyside6-qss 6.12,active,2026-11-24
|
|
28
|
+
16,Typography,Set a readable minimum body size,Desktop utility text below 14px becomes dense and hard to scan at native DPI,Keep body text at 14 px or larger and secondary text at 12 px,Do not drop body text below 14 px,Keep body labels at 14px or larger and secondary labels at 12px,label = BodyLabel('Scan results'); label.setFontSize(14),Medium,https://qfluentwidgets.com/,pyside6-qss 6.12,active,2026-11-24
|
|
29
|
+
17,Typography,Use the library label components instead of raw QLabel,qfluentwidgets labels carry the theme font and colour roles; a bare QLabel does not follow theme changes,Use the library label components so type and colour follow the theme,Do not use a bare QLabel for styled text,Use BodyLabel StrongBodyLabel SubtitleLabel TitleLabel LargeTitleLabel CaptionLabel,title = TitleLabel('Deep Clean'),Medium,https://qfluentwidgets.com/,pyside6-qss 6.12,active,2026-11-24
|
|
30
|
+
18,Typography,Set font size once per role not per widget,Scattering setFontSize calls across widgets makes the type scale drift,Define the type scale in one place and apply it per role,Do not scatter individual font size calls across widgets,Define the scale in one place and apply it per role,"SIZES = {'title': 20, 'body': 14, 'caption': 12}",Low,https://doc.qt.io/qt-6/qfont.html,pyside6-qss 6.12,active,2026-11-24
|
|
31
|
+
19,Layout,Use the library layout helpers for consistent spacing,qfluentwidgets ships VBoxLayout HBoxLayout and GridLayout that apply its spacing and margins defaults,Use the library layout classes so spacing is consistent across pages,Do not mix raw Qt layouts with library layouts on the same page,Use the library layout classes so spacing is consistent across pages,layout = VBoxLayout(self); layout.addWidget(card),Low,https://qfluentwidgets.com/,pyside6-qss 6.12,active,2026-11-24
|
|
32
|
+
20,Layout,Use the library card components instead of custom QFrame,SimpleCardWidget CardWidget and ElevatedCardWidget already carry the theme border radius and shadow,Build grouped content on a library card that already carries radius and shadow,Do not hand-roll a card frame with a custom stylesheet,Use a library card as the base for grouped content,card = SimpleCardWidget(self),Medium,https://qfluentwidgets.com/,pyside6-qss 6.12,active,2026-11-24
|
|
33
|
+
21,Lists,Use model view for large result lists,Creating one widget per row for hundreds of entries is slow and memory heavy,Use a model with a view for large result sets,Do not create one widget per row for hundreds of entries,Use QAbstractListModel with QListView or QTableView for large sets,model = ResultModel(rows); view.setModel(model),High,https://doc.qt.io/qt-6/model-view-programming.html,pyside6-qss 6.12,active,2026-11-24
|
|
34
|
+
22,Lists,Use a custom delegate for row rendering,Delegates paint rows without creating widgets which keeps scrolling smooth at high row counts,Paint rows inside a delegate so scrolling stays smooth,Do not render a widget inside the delegate paint method,Implement QStyledItemDelegate and paint the row in paint and sizeHint,"class RowDelegate(QStyledItemDelegate):
|
|
35
|
+
def paint(self, painter, option, index): ...",Medium,https://doc.qt.io/qt-6/qstyleditemdelegate.html,pyside6-qss 6.12,active,2026-11-24
|
|
36
|
+
23,Lists,Give every interactive row a visible hover and selected state,Rows without distinct hover and selected states read as a static table and give no feedback,Implement a distinct hover state and a stronger selected state,Do not leave rows without any hover or selected feedback,Implement both states in the delegate and keep the selected state clearly stronger than hover,"def paint(self, painter, option, index):
|
|
37
|
+
if option.state & QStyle.State_Selected: ...",High,https://doc.qt.io/qt-6/qstyleditemdelegate.html,pyside6-qss 6.12,active,2026-11-24
|
|
38
|
+
24,Interaction,Give destructive actions a confirm step and a distinct affordance,Actions that permanently delete need to be visually and behaviourally separated from safe ones,Use the primary button for the main action and require an explicit confirm for destructive ones,Do not style a permanent delete as an ordinary action,Use PrimaryPushButton for the main action and require an explicit confirm for destructive actions,delete_btn = PrimaryPushButton('Move to Recycle Bin'),High,https://qfluentwidgets.com/,pyside6-qss 6.12,active,2026-11-24
|
|
39
|
+
25,Interaction,Never let the confirm dialog default to the destructive choice,A dialog whose default button is the destructive one turns one stray Enter into a deletion,Make the safe option the default so a stray Enter never deletes,Do not make the destructive button the default choice,Make the safe option the default and require an explicit click on the destructive one,box.setDefaultButton(cancel_btn),Critical,https://doc.qt.io/qt-6/qmessagebox.html,pyside6-qss 6.12,active,2026-11-24
|
|
40
|
+
26,Interaction,Show progress during long operations,An operation with no visible progress reads as a frozen application and invites duplicate clicks,Show a determinate progress bar with a percentage and a remaining estimate,Do not leave a long operation with no visible progress,Show a determinate progress bar with a percentage and a remaining estimate,"progress.setRange(0, total); progress.setValue(done)",High,https://qfluentwidgets.com/,pyside6-qss 6.12,active,2026-11-24
|
|
41
|
+
27,Interaction,Keep the minimum hit area at 32 by 32,Small icon-only buttons are hard to hit and look unfinished,Enforce a minimum hit area on icon buttons and tool buttons,Do not shrink interactive controls below a usable size,Enforce a minimum size on icon buttons and tool buttons,"btn.setFixedSize(32, 32)",Medium,https://doc.qt.io/qt-6/qwidget.html#sizeHints,pyside6-qss 6.12,active,2026-11-24
|
|
42
|
+
28,Accessibility,Set an accessible name on icon-only controls,An icon-only button exposes no text to screen readers and to voice control,Set an accessible name on every icon-only control,Do not rely on a tooltip as the only accessible label,Set accessibleName alongside the tooltip for every icon-only control,btn.setAccessibleName('Close window'),High,https://doc.qt.io/qt-6/qaccessible.html,pyside6-qss 6.12,active,2026-11-24
|
|
43
|
+
29,Accessibility,Keep focus visible and reachable by keyboard,Removing the focus ring makes keyboard navigation impossible to follow,Keep the focus indicator and keep every control reachable in tab order,Do not remove the focus policy from interactive widgets,Keep the default focus indicator and ensure every interactive widget is reachable in tab order,btn.setFocusPolicy(Qt.StrongFocus),High,https://doc.qt.io/qt-6/qwidget.html#focus,pyside6-qss 6.12,active,2026-11-24
|
|
44
|
+
30,Accessibility,Use QLabel buddy for form fields,A standalone label is not associated with its input so screen readers announce it without the field,Bind each label to its field as a buddy,Do not leave a standalone label next to an unbound input,label.setBuddy(field),label = BodyLabel('Target'); field = LineEdit(),Medium,https://doc.qt.io/qt-6/qlabel.html#buddy,pyside6-qss 6.12,active,2026-11-24
|
|
45
|
+
31,Window,Use FluentWindow for the shell and addSubInterface for pages,FluentWindow provides the title bar and the animated page switch,Use FluentWindow for the shell and addSubInterface for the pages,Do not build the shell from a bare QMainWindow with a manual stack,Register each page with addSubInterface and use the library icons,"self.addSubInterface(self.home_page, FluentIcon.HOME, 'Home')",Medium,https://qfluentwidgets.com/,pyside6-qss 6.12,active,2026-11-24
|
|
46
|
+
32,Window,Use the library icon set for navigation,Mixing icon families breaks visual consistency; FluentIcon covers the common cases,Map every navigation and action icon to a FluentIcon,Do not mix icon families or draw ad hoc glyphs,Map each navigation entry to a FluentIcon,FluentIcon.BROOM,Low,https://qfluentwidgets.com/,pyside6-qss 6.12,active,2026-11-24
|
|
47
|
+
33,Motion,Respect the system reduce-motion setting,Users who disabled OS animations still need the interface to be usable even if transitions shorten,Shorten or skip transitions when the system reports reduced motion while keeping the end state correct,Do not ignore the system reduce motion setting,Shorten or skip transitions when the OS reports reduced motion while keeping the end state correct,if reduced_motion: widget.setValue(target),Medium,https://doc.qt.io/qt-6/qt.html#app-style-hints,pyside6-qss 6.12,active,2026-11-24
|
|
48
|
+
34,Motion,Do not add motion to every state change,Animation on every widget turns an interface into noise; reserve it for changes the user initiated,Animate only the changes the user initiated,Do not animate every state change on every widget,Animate expand collapse selection and progress only,"self._fade_anim = QPropertyAnimation(self, b'opacity')",Medium,https://doc.qt.io/qt-6/qobject.html,pyside6-qss 6.12,active,2026-11-24
|
|
49
|
+
35,Motion,Keep transition durations in the 160 to 220 ms band,Shorter than 120 ms is perceived as a jump and longer than 300 ms feels sluggish for a local desktop app,Keep panel and card transitions in the 160 to 220 ms band and press feedback at 100 to 150 ms,Do not use transitions long enough to feel sluggish,Use 160-220 ms for panel and card transitions and 100-150 ms for press feedback,anim.setDuration(200),Medium,https://doc.qt.io/qt-6/qobject.html,pyside6-qss 6.12,active,2026-11-24
|
|
50
|
+
36,Density,Do not fill the viewport with equally weighted panels,When every panel is the same size the interface reads as a dashboard with no hierarchy,Give the primary task the largest area and let secondary panels shrink,Do not give every panel an equal stretch,Give the primary task the largest area and let secondary panels shrink,main.setStretch(3); side.setStretch(1),High,https://doc.qt.io/qt-6/qobject.html,pyside6-qss 6.12,active,2026-11-24
|
|
51
|
+
37,Density,Prefer a card list over a multi-column table for categorical results,A table with index column and checkbox column reads as a spreadsheet rather than a consumer utility,Render each category as a card with an icon a title and a summary line,Do not use a multi column table with an index and a checkbox for categorical results,Render each category as a card with an icon a title and a summary line,category_card = SimpleCardWidget(self),Medium,https://doc.qt.io/qt-6/qobject.html,pyside6-qss 6.12,active,2026-11-24
|
|
52
|
+
38,Density,Keep one visual focus per screen,A screen with several equally large numbers has no reading order,Make the single most important number large and the rest secondary,Do not give several numbers the same visual weight,Make the single most important number large and the rest secondary,value_label.setFontSize(28); hint.setFontSize(12),Medium,https://doc.qt.io/qt-6/qobject.html,pyside6-qss 6.12,active,2026-11-24
|
|
53
|
+
39,Threading,Use QThread subclass with run for background work,A QThread subclass moves the work into run while the GUI thread stays responsive,Subclass QThread and emit a Signal when the work finishes,Do not run the work directly on the GUI thread,Subclass QThread and emit a Signal when the work finishes,"class Worker(QThread):
|
|
54
|
+
finished_ok = Signal(object)
|
|
55
|
+
def run(self):
|
|
56
|
+
self.finished_ok.emit(compute())",High,https://doc.qt.io/qt-6/qthread.html,pyside6-qss 6.12,active,2026-11-24
|
|
57
|
+
40,Threading,Use QObject worker with moveToThread for long jobs,A QObject worker moved to a thread supports queued signals and a clean shutdown,Move a QObject worker to a dedicated QThread for a deterministic stop path,Do not leave a long job on the GUI thread,A QObject worker moved to a dedicated QThread gives a deterministic stop path,"self.worker.moveToThread(self.thread)
|
|
58
|
+
self.thread.started.connect(self.worker.run)",Medium,https://doc.qt.io/qt-6/qobject.html#thread-affinity,pyside6-qss 6.12,active,2026-11-24
|
|
59
|
+
41,Threading,Signal and Slot are the thread-safe boundary,Emitting a Signal from a worker thread marshals the call onto the receiver thread,Declare a Signal on the worker and connect it to a slot on the widget,Do not touch the widget directly from the worker,Declare a Signal on the worker and connect it to a slot on the widget,"class Worker(QThread):
|
|
60
|
+
progress = Signal(int)
|
|
61
|
+
def run(self): self.progress.emit(42)",Critical,https://doc.qt.io/qt-6/signalsandslots.html,pyside6-qss 6.12,active,2026-11-24
|
|
62
|
+
42,Threading,Wait for a worker to finish before closing the window,Exiting while a QThread is running raises QThread destroyed while it is still running,Quit and wait for the thread before the window closes,Do not exit while a worker thread is still running,Connect the worker finished signal to quit and wait before the window closes,"thread.finished.connect(thread.quit)
|
|
63
|
+
thread.finished.connect(worker.deleteLater)
|
|
64
|
+
thread.quit(); thread.wait()",Critical,https://doc.qt.io/qt-6/qthread.html#destroying-a-thread,pyside6-qss 6.12,active,2026-11-24
|
|
65
|
+
43,Threading,Guard the shutdown of a running worker,Closing the app during an active scan leaves a half-written state,Set the stop event and wait for the worker before the window disappears,Do not terminate the thread abruptly,Track a running flag and stop the worker before the window disappears,if self._running: self._stop_event.set(); self._worker.wait(),High,https://doc.qt.io/qt-6/qthread.html#destroying-a-thread,pyside6-qss 6.12,active,2026-11-24
|
|
66
|
+
44,Dialogs,Use QMessageBox with an explicit safe default,A default button on the destructive option turns a stray Enter into a deletion,Make the cancel button the default and require an explicit click on the destructive one,Do not make the destructive button the default choice,Make the cancel button the default and require an explicit click on the destructive one,"box = QMessageBox(QMessageBox.Question, 'Move to Recycle Bin', 'Move 120 items?')
|
|
67
|
+
box.setDefaultButton(cancel_btn)",Critical,https://doc.qt.io/qt-6/qmessagebox.html,pyside6-qss 6.12,active,2026-11-24
|
|
68
|
+
45,Dialogs,Show the concrete impact in the confirmation text,A generic Are you sure gives the user no basis for a decision,State the item count and the total size in the confirmation text,Do not ask a generic confirmation with no numbers,State the item count and the total size before asking,"QMessageBox.question(self, 'Move to Recycle Bin', f'Move {count} items ({size}) to the Recycle Bin?')",Medium,https://doc.qt.io/qt-6/qmessagebox.html,pyside6-qss 6.12,active,2026-11-24
|
|
69
|
+
46,Dialogs,Keep a modal dialog on top of its parent,A dialog that opens behind the main window looks broken and can be missed,Pass the parent widget so the dialog is centred and stays modal,Do not open the dialog without a parent,Pass the parent widget so the dialog is centred and stays modal,"QMessageBox.question(self, ...)",Medium,https://doc.qt.io/qt-6/qdialog.html,pyside6-qss 6.12,active,2026-11-24
|
|
70
|
+
47,Data,Use QAbstractListModel with QAbstractItemModel for result rows,Building one widget per row for hundreds of entries is slow and heavy on memory,Use a QAbstractListModel with QListView or QTableView for large result sets,Do not create one widget per row for hundreds of entries,Use QAbstractListModel with QListView or QTableView for large sets,"model = ResultModel(rows)
|
|
71
|
+
view.setModel(model)",High,https://doc.qt.io/qt-6/model-view-programming.html,pyside6-qss 6.12,active,2026-11-24
|
|
72
|
+
48,Data,Implement data as a model role rather than a custom widget subclass,Model roles keep rendering in the delegate and avoid subclassing widgets for each row,Expose the display text through a model role and override data,Do not subclass a widget per row type,Expose the display text through Qt.ItemDataRole.DisplayRole and override data,"def data(self, index, role):
|
|
73
|
+
if role == Qt.ItemDataRole.DisplayRole: return self.rows[index.row()].name",Medium,https://doc.qt.io/qt-6/qabstractitemmodel.html,pyside6-qss 6.12,active,2026-11-24
|
|
74
|
+
49,Data,Update models with beginResetModel and endResetModel,Mutating a model outside a reset leaves the view showing stale rows,Wrap a full reload in beginResetModel and endResetModel,Do not replace the row list without a reset,Wrap a full reload in beginResetModel and endResetModel,"self.beginResetModel()
|
|
75
|
+
self.rows = new_rows
|
|
76
|
+
self.endResetModel()",High,https://doc.qt.io/qt-6/qabstractitemmodel.html#subclassing,pyside6-qss 6.12,active,2026-11-24
|
|
77
|
+
50,Input,Use SearchLineEdit for search fields,The library search field adds the clear button and the correct focus styling,Use SearchLineEdit for any filter field,Do not use a bare LineEdit for a search field,Use SearchLineEdit rather than a bare LineEdit for any filter field,edit = SearchLineEdit(self),Low,https://qfluentwidgets.com/,pyside6-qss 6.12,active,2026-11-24
|
|
78
|
+
51,Input,Give every input a label bound as buddy,A label that is not associated with its field is announced without the field,Bind each label to its field as a buddy,Do not leave a standalone label next to an unbound input,Call setBuddy so the label and the field are linked,label.setBuddy(field),Medium,https://doc.qt.io/qt-6/qlabel.html#buddy,pyside6-qss 6.12,active,2026-11-24
|
|
79
|
+
52,Input,Validate input before accepting it with a QValidator,Silent coercion of a bad value produces a wrong result that is hard to trace,Attach a QIntValidator or QDoubleValidator and show the reason inline,Do not silently coerce a bad value,Attach a QIntValidator or QDoubleValidator and show the reason inline next to the field,"spin.setRange(0, 100000000)
|
|
80
|
+
spin.setSuffix(' B')
|
|
81
|
+
spin.setValidator(QIntValidator(0, 100000000))",Medium,https://doc.qt.io/qt-6/qvalidator.html,pyside6-qss 6.12,active,2026-11-24
|
|
82
|
+
53,Feedback,Show a determinate progress bar with a percentage and a remaining estimate,An indeterminate spinner gives no sense of how long the operation will take,Set a range and a value and pair the bar with a text summary,Do not use an indeterminate range for a known total,Set a range and a value and pair it with a text summary,"progress.setRange(0, total)
|
|
83
|
+
progress.setValue(done)
|
|
84
|
+
progress.setFormat(f'{done} / {total}')",High,https://qfluentwidgets.com/,pyside6-qss 6.12,active,2026-11-24
|
|
85
|
+
54,Feedback,Make the cancel action reachable during a long operation,A user trapped by an uncancellable operation will force kill the app,Offer a cancel button that sets the worker stop event and report that it was requested,Do not disable the cancel action during a long operation,Offer a cancel button that sets the worker stop event and report that it was requested,cancel_btn.clicked.connect(self._request_stop),High,https://doc.qt.io/qt-6/qthread.html,pyside6-qss 6.12,active,2026-11-24
|
|
86
|
+
55,Feedback,Distinguish a stale result from a fresh one,Showing an old number as current misleads the user about what the app is doing,Mark a snapshot as stale and say so next to the value,Do not present an old value as a current one,Mark the snapshot as stale and say so next to the value,status.setText('Snapshot is 6 minutes old'),Medium,https://doc.qt.io/qt-6/qwidget.html,pyside6-qss 6.12,active,2026-11-24
|
|
87
|
+
56,Focus,Keep focus order matching the visual order,Tab order that jumps around forces the user to hunt for the next control,Set the tab order explicitly to follow the visual sequence,Do not leave the tab order to follow insertion order,Set the tab order explicitly to follow the visual sequence,"QWidget.setTabOrder(a, b); QWidget.setTabOrder(b, c)",Medium,https://doc.qt.io/qt-6/qwidget.html#focus,pyside6-qss 6.12,active,2026-11-24
|
|
88
|
+
57,Focus,Do not steal focus on a background update,A background refresh that grabs focus interrupts typing,Update the label text without activating the window,Do not steal focus during a background update,Update the label text without calling setFocus or activating the window,label.setText(value),High,https://doc.qt.io/qt-6/qwidget.html#focus,pyside6-qss 6.12,active,2026-11-24
|
|
89
|
+
58,Focus,Move focus into a dialog when it opens,A dialog that opens with focus on its close button invites an accidental dismissal,Set the initial focus to the safe action inside the dialog,Do not open the dialog with focus on the destructive action,Set the initial focus to the safe action inside the dialog,"box.setDefaultButton(cancel_btn)
|
|
90
|
+
box.button(cancel_btn).setFocus()",Medium,https://doc.qt.io/qt-6/qdialog.html,pyside6-qss 6.12,active,2026-11-24
|
|
91
|
+
59,Painting,Use QPainter with the antialiasing hint for custom painting,Without antialiasing custom drawn shapes look jagged at native DPI,Enable the antialiasing render hint before drawing custom shapes,Do not draw custom shapes without antialiasing,Enable QPainter.RenderHint.Antialiasing before drawing,"painter.setRenderHint(QPainter.RenderHint.Antialiasing)
|
|
92
|
+
painter.drawPath(path)",Medium,https://doc.qt.io/qt-6/qpainter.html,pyside6-qss 6.12,active,2026-11-24
|
|
93
|
+
60,Painting,Use devicePixelRatio for crisp output on high DPI screens,Drawing at logical pixels makes custom art blurry on a scaled display,Multiply by devicePixelRatio and set it on the pixmap,Do not draw custom art at logical pixels only,Multiply by devicePixelRatio and set the device pixel ratio on the widget,"ratio = self.devicePixelRatioF()
|
|
94
|
+
image.setDevicePixelRatio(ratio)",High,https://doc.qt.io/qt-6/qpaintdevice.html#device-pixel-ratio,pyside6-qss 6.12,active,2026-11-24
|
|
95
|
+
61,Painting,Prefer drawing a cached sprite over rebuilding gradients each frame,Recreating a gradient every frame is the usual cause of a stuttering animation,Build the sprite once and draw it each frame,Do not rebuild a gradient every frame,Build the sprite once and draw it each frame,"sprite = build_sprite()
|
|
96
|
+
painter.drawImage(x, y, sprite)",High,https://doc.qt.io/qt-6/qpixmap.html,pyside6-qss 6.12,active,2026-11-24
|
|
97
|
+
62,Painting,Keep custom painting off the hot path when the view is hidden,Painting a hidden widget wastes CPU and can keep a fan spinning,Skip painting while the widget is not visible,Do not keep painting a hidden widget,Skip painting when the widget is not visible,if not self.isVisible(): return,Medium,https://doc.qt.io/qt-6/qwidget.html#paint-events,pyside6-qss 6.12,active,2026-11-24
|
|
98
|
+
63,Icons,Use FluentIcon for every navigation and action icon,Mixing icon families breaks the visual consistency of the shell,Map every action to a FluentIcon from the library,Do not mix icon families or draw ad hoc glyphs,Map each action to a FluentIcon from the library,FluentIcon.BROOM,Low,https://qfluentwidgets.com/,pyside6-qss 6.12,active,2026-11-24
|
|
99
|
+
64,Icons,Do not use an icon whose shape implies a different action,An icon that reads as a pencil suggests editing even when the button deletes,Pick an icon that matches the action and keep the tooltip consistent,Do not use an icon whose shape implies a different action,Pick an icon that matches the action and keep the tooltip consistent,btn = ToolButton(); btn.setIcon(FluentIcon.DELETE),Medium,https://qfluentwidgets.com/,pyside6-qss 6.12,active,2026-11-24
|
|
100
|
+
65,Layout,Use QScrollArea for content that can exceed the viewport,Without a scroll area the content is clipped and the lower part becomes unreachable,Wrap the page content in a QScrollArea so nothing is cut off,Do not let content overflow the viewport silently,Wrap the page content in a QScrollArea so nothing is cut off,scroll = QScrollArea(); scroll.setWidgetResizable(True),High,https://doc.qt.io/qt-6/qscrollarea.html,pyside6-qss 6.12,active,2026-11-24
|
|
101
|
+
66,Layout,Keep the scroll area background transparent,An opaque scroll area background creates a visible band that breaks the page,Set the viewport background to transparent and match the page colour,Do not leave an opaque band behind the scroll area,Set the viewport background to transparent and match the page colour,scroll.viewport().setStyleSheet('background: transparent'),Medium,https://doc.qt.io/qt-6/qscrollarea.html,pyside6-qss 6.12,active,2026-11-24
|
|
102
|
+
67,Layout,Use a QStackedWidget for in-page mode switches,Swapping page widgets on navigation makes the layout jump,Keep one widget and switch its content inside a QStackedWidget,Do not remove and re-add page widgets to change mode,Keep one widget and switch its content inside a QStackedWidget,stack = QStackedWidget(); stack.addWidget(clean_page); stack.addWidget(settings_page),Medium,https://doc.qt.io/qt-6/qstackedwidget.html,pyside6-qss 6.12,active,2026-11-24
|
|
103
|
+
68,Layout,Keep the window minimum size large enough for the layout,Setting a minimum below the content size causes clipping and overlapping labels,Set a minimum size that fits the narrowest supported layout,Do not set a minimum size below the content size,Set a minimum size that fits the narrowest supported layout,"self.setMinimumSize(1000, 700)",Medium,https://doc.qt.io/qt-6/qwidget.html#sizeHints,pyside6-qss 6.12,active,2026-11-24
|
|
@@ -0,0 +1,52 @@
|
|
|
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
|
|
@@ -0,0 +1,67 @@
|
|
|
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
|
|
@@ -0,0 +1,69 @@
|
|
|
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
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
No,Category,Guideline,Description,Do,Don't,Code Good,Code Bad,Severity,Docs URL,Applies To,Status,Verified At
|
|
2
|
+
1,Reactivity,Use $: for reactive statements,Legacy-mode automatic dependency tracking,$: only while maintaining a legacy-mode component,Use $: in new runes-mode code,$: doubled = count * 2,let doubled = $derived(count * 2),Medium,https://svelte.dev/docs/svelte/legacy-reactive-assignments,svelte legacy <=4,deprecated,2026-08-13
|
|
3
|
+
2,Reactivity,Trigger legacy reactivity with assignment,Legacy-mode reactivity tracks assignments,Reassign arrays or objects in legacy mode,Treat assignment as the Svelte 5 runes contract,"items = [...items, newItem]",let items = $state([]),High,https://svelte.dev/docs/svelte/legacy-let,svelte legacy <=4,deprecated,2026-08-13
|
|
4
|
+
3,Reactivity,Use $state in Svelte 5,Runes for explicit reactivity,let count = $state(0),Implicit reactivity in Svelte 5,let count = $state(0),let count = 0 (Svelte 5),Medium,https://svelte.dev/blog/runes,svelte 5,active,2026-08-13
|
|
5
|
+
4,Reactivity,Use $derived for computed values,$derived replaces $: in Svelte 5,let doubled = $derived(count * 2),$: in Svelte 5,let doubled = $derived(count * 2),$: doubled = count * 2 (Svelte 5),Medium,,svelte 5,active,2026-08-13
|
|
6
|
+
5,Reactivity,Use $effect for side effects,$effect replaces $: side effects,Use $effect for subscriptions,$: for side effects in Svelte 5,$effect(() => console.log(count)),$: console.log(count) (Svelte 5),Medium,,svelte 5,active,2026-08-13
|
|
7
|
+
6,Props,Use export let for legacy props,Declare props with export let only in legacy mode,Retain export let while maintaining legacy components,Introduce export let in new runes-mode components,export let count = 0,let { count = 0 } = $props(),High,https://svelte.dev/docs/svelte/legacy-export-let,svelte legacy <=4,deprecated,2026-08-13
|
|
8
|
+
7,Props,Use $props in Svelte 5,$props rune for prop access,let { name } = $props(),export let in Svelte 5,"let { name, age = 0 } = $props()",export let name; export let age = 0,Medium,,svelte 5,active,2026-08-13
|
|
9
|
+
8,Props,Provide prop default values,Destructure defaults from $props,Use defaults in $props destructuring,Add separate fallback mutation,let { count = 0 } = $props(),let { count } = $props(); count ??= 0,Low,https://svelte.dev/docs/svelte/$props,svelte 5,active,2026-08-13
|
|
10
|
+
9,Props,Use rest props in runes mode,Pass through unknown props with $props rest destructuring,Spread a rest object onto the element,Use legacy $$restProps,"let { class: className, ...rest } = $props(); <button {...rest}>",<button {...$$restProps}>,Low,https://svelte.dev/docs/svelte/$props,svelte 5,active,2026-08-13
|
|
11
|
+
10,Bindings,Use bind: for two-way binding,Simplified input handling,bind:value for inputs,on:input with manual update,<input bind:value={name}>,<input value={name} on:input={e => name = e.target.value}>,Low,https://svelte.dev/docs/element-directives#bind-property,svelte 5,active,2026-08-13
|
|
12
|
+
11,Bindings,Bind to DOM elements,Reference DOM nodes,bind:this for element reference,querySelector in onMount,<div bind:this={el}>,onMount(() => el = document.querySelector()),Medium,,svelte 5,active,2026-08-13
|
|
13
|
+
12,Bindings,Use bind:group for radios/checkboxes,Simplified group handling,bind:group for radio/checkbox groups,Manual checked handling,"<input type=""radio"" bind:group={selected}>","<input type=""radio"" checked={selected === value}>",Low,,svelte 5,active,2026-08-13
|
|
14
|
+
13,Events,Use on: for legacy event handlers,Event directive syntax for legacy components,on:click only while maintaining legacy mode,Introduce on: handlers in runes mode,<button on:click={handleClick}>,<button onclick={handleClick}>,Medium,https://svelte.dev/docs/svelte/legacy-on,svelte legacy <=4,deprecated,2026-08-13
|
|
15
|
+
14,Events,Forward events with on:event in legacy mode,Legacy event forwarding without a handler,on:click only for a legacy component,Use legacy forwarding in runes mode,<button on:click>,<button onclick={onclick}>,Low,https://svelte.dev/docs/svelte/legacy-on,svelte legacy <=4,deprecated,2026-08-13
|
|
16
|
+
15,Events,Use createEventDispatcher only in legacy components,Legacy custom component events,Retain dispatch while maintaining legacy components,Add createEventDispatcher to new runes-mode code,"dispatch('save', { data })",let { onsave } = $props(),Medium,https://svelte.dev/docs/svelte/svelte#createeventdispatcher,svelte legacy <=4,deprecated,2026-08-13
|
|
17
|
+
16,Lifecycle,Use onMount for initialization,Run code after component mounts,onMount for setup and data fetching,Code in script body for side effects,onMount(() => fetchData()),fetchData() in script body,High,https://svelte.dev/docs/svelte#onmount,svelte 5,active,2026-08-13
|
|
18
|
+
17,Lifecycle,Return cleanup from onMount,Automatic cleanup on destroy,Return function from onMount,Separate onDestroy for paired cleanup,onMount(() => { sub(); return unsub }),onMount(sub); onDestroy(unsub),Medium,,svelte 5,active,2026-08-13
|
|
19
|
+
18,Lifecycle,Use onDestroy sparingly,Only when onMount cleanup not possible,onDestroy for non-mount cleanup,onDestroy for mount-related cleanup,onDestroy for store unsubscribe,onDestroy(() => clearInterval(id)),Low,,svelte 5,active,2026-08-13
|
|
20
|
+
19,Lifecycle,Avoid beforeUpdate and afterUpdate,Legacy lifecycle hooks are unavailable in runes mode,Use $effect.pre and $effect only when synchronization is required,Use lifecycle hooks or reactive assignments for derived state,$effect.pre(() => measure()),beforeUpdate(() => measure()),Low,https://svelte.dev/docs/svelte/lifecycle-hooks,svelte 5,active,2026-08-13
|
|
21
|
+
20,Stores,Use writable for mutable state,Basic reactive store,writable for shared mutable state,Local variables for shared state,const count = writable(0),let count = 0 in module,Medium,https://svelte.dev/docs/svelte-store#writable,svelte 5,active,2026-08-13
|
|
22
|
+
21,Stores,Use readable for read-only state,External data sources,readable for derived/external data,writable for read-only data,"readable(0, set => interval(set))",writable(0) for timer,Low,https://svelte.dev/docs/svelte-store#readable,svelte 5,active,2026-08-13
|
|
23
|
+
22,Stores,Use derived for computed stores,Combine or transform stores,derived for computed values,Manual subscription for derived,"derived(count, $c => $c * 2)",count.subscribe(c => doubled = c * 2),Medium,https://svelte.dev/docs/svelte-store#derived,svelte 5,active,2026-08-13
|
|
24
|
+
23,Stores,Use $ prefix for auto-subscription,Automatic subscribe/unsubscribe,$storeName in components,Manual subscription,{$count},count.subscribe(c => value = c),High,https://svelte.dev/docs/svelte/stores,svelte 5,active,2026-08-13
|
|
25
|
+
24,Stores,Clean up custom subscriptions,Unsubscribe when component destroys,Return unsubscribe from onMount,Leave subscriptions open,onMount(() => store.subscribe(fn)),store.subscribe(fn) in script,High,https://svelte.dev/docs/svelte/stores,svelte 5,active,2026-08-13
|
|
26
|
+
25,Slots,Use slots for legacy composition,Legacy content projection with slot elements,Retain slots while maintaining legacy components,Introduce slot elements in runes-mode components,<slot>Default</slot>,{@render children()},Medium,https://svelte.dev/docs/svelte/legacy-slots,svelte legacy <=4,deprecated,2026-08-13
|
|
27
|
+
26,Slots,Use named slots for legacy areas,Legacy composition with multiple slot elements,Retain named slots only in legacy components,Add named slots to new runes-mode code,"<slot name=""header"">",{@render header()},Low,https://svelte.dev/docs/svelte/legacy-slots,svelte legacy <=4,deprecated,2026-08-13
|
|
28
|
+
27,Slots,Check slot content with $$slots in legacy mode,Legacy conditional slot rendering,Retain $$slots only in legacy components,Use $$slots in runes mode,"{#if $$slots.footer}<slot name=""footer""/>{/if}","{#if footer}{@render footer()}{/if}",Low,https://svelte.dev/docs/svelte/legacy-$$slots,svelte legacy <=4,deprecated,2026-08-13
|
|
29
|
+
28,Styling,Use scoped styles by default,Styles scoped to component,<style> for component styles,Global styles for component,:global() only when needed,<style> all global,Medium,https://svelte.dev/docs/svelte-components#style,svelte 5,active,2026-08-13
|
|
30
|
+
29,Styling,Use :global() sparingly,Escape scoping when needed,:global for third-party styling,Global for all styles,:global(.external-lib),<style> without scoping,Medium,,svelte 5,active,2026-08-13
|
|
31
|
+
30,Styling,Use CSS variables for theming,Dynamic styling,CSS custom properties,Inline styles for themes,"style=""--color: {color}""","style=""color: {color}""",Low,,svelte 5,active,2026-08-13
|
|
32
|
+
31,Transitions,Use built-in transitions,Svelte transition directives,transition:fade for simple effects,Manual CSS transitions,<div transition:fade>,<div class:fade={visible}>,Low,https://svelte.dev/docs/element-directives#transition-fn,svelte 5,active,2026-08-13
|
|
33
|
+
32,Transitions,Use in: and out: separately,Different enter/exit animations,in:fly out:fade for asymmetric,Same transition for both,<div in:fly out:fade>,<div transition:fly>,Low,,svelte 5,active,2026-08-13
|
|
34
|
+
33,Transitions,Add local modifier,Prevent ancestor trigger,transition:fade|local,Global transitions for lists,<div transition:slide|local>,<div transition:slide>,Medium,,svelte 5,active,2026-08-13
|
|
35
|
+
34,Actions,Use actions for DOM behavior,Reusable DOM logic,use:action for DOM enhancements,onMount for each usage,<div use:clickOutside>,onMount(() => setupClickOutside(el)),Medium,https://svelte.dev/docs/element-directives#use-action,svelte 5,active,2026-08-13
|
|
36
|
+
35,Actions,Return update and destroy,Lifecycle methods for actions,"Return { update, destroy }",Only initial setup,"return { update(params) {}, destroy() {} }",return destroy only,Medium,,svelte 5,active,2026-08-13
|
|
37
|
+
36,Actions,Pass parameters to actions,Configure action behavior,use:action={params},Hardcoded action behavior,<div use:tooltip={options}>,<div use:tooltip>,Low,,svelte 5,active,2026-08-13
|
|
38
|
+
37,Logic,Use {#if} for conditionals,Template conditionals,{#if} {:else if} {:else},Ternary in expressions,{#if cond}...{:else}...{/if},{cond ? a : b} for complex,Low,https://svelte.dev/docs/logic-blocks#if,svelte 5,active,2026-08-13
|
|
39
|
+
38,Logic,Use {#each} for lists,List rendering,{#each} with key,Map in expression,{#each items as item (item.id)},{items.map(i => `<div>${i}</div>`)},Medium,,svelte 5,active,2026-08-13
|
|
40
|
+
39,Logic,Always use keys in {#each},Proper list reconciliation,(item.id) for unique key,Index as key or no key,{#each items as item (item.id)},"{#each items as item, i (i)}",High,https://svelte.dev/docs/svelte/each,svelte 5,active,2026-08-13
|
|
41
|
+
40,Logic,Use {#await} for promises,Handle async states,{#await} for loading/error states,Manual promise handling,{#await promise}...{:then}...{:catch},{#if loading}...{#if error},Medium,https://svelte.dev/docs/logic-blocks#await,svelte 5,active,2026-08-13
|
|
42
|
+
41,SvelteKit,Use +page.svelte for routes,File-based routing,+page.svelte for route components,Custom routing setup,routes/about/+page.svelte,routes/About.svelte,Medium,https://kit.svelte.dev/docs/routing,svelte 5,active,2026-08-13
|
|
43
|
+
42,SvelteKit,Use +page.js for data loading,Load data before render,load function in +page.js,onMount for data fetching,export function load() {},onMount(() => fetchData()),High,https://kit.svelte.dev/docs/load,svelte 5,active,2026-08-13
|
|
44
|
+
43,SvelteKit,Use +page.server.js for server-only,Server-side data loading,+page.server.js for sensitive data,+page.js for API keys,+page.server.js with DB access,+page.js with DB access,High,https://svelte.dev/docs/kit/load#universal-vs-server,svelte 5,active,2026-08-13
|
|
45
|
+
44,SvelteKit,Use form actions,Server-side form handling,+page.server.js actions,API routes for forms,export const actions = { default },fetch('/api/submit'),Medium,https://kit.svelte.dev/docs/form-actions,svelte 5,active,2026-08-13
|
|
46
|
+
45,SvelteKit,Use $app/stores for legacy app state,Legacy SvelteKit page navigating and updated stores,Retain $app/stores only for legacy Svelte projects,Add $app/stores to new SvelteKit code,import { page } from '$app/stores',import { page } from '$app/state',Medium,https://svelte.dev/docs/kit/$app-stores,svelte legacy <=4,deprecated,2026-08-13
|
|
47
|
+
46,Performance,Use {#key} for forced re-render,Reset component state,{#key id} for fresh instance,Manual destroy/create,{#key item.id}<Component/>{/key},on:change={() => component = null},Low,https://svelte.dev/docs/logic-blocks#key,svelte 5,active,2026-08-13
|
|
48
|
+
47,Performance,Avoid unnecessary effects,Not every computation needs $effect,Use $derived for computed state and $effect only for external synchronization,Use effects for simple assignments,let doubled = $derived(count * 2),$effect(() => doubled = count * 2),Low,https://svelte.dev/docs/svelte/$effect,svelte 5,active,2026-08-13
|
|
49
|
+
48,Performance,Avoid legacy immutable compiler assumptions,Runes use fine-grained reactivity without the legacy immutable option,Use current runes state and measure real bottlenecks,Add immutable mode to new runes components,$state for reactive data,<svelte:options immutable/>,Low,https://svelte.dev/docs/svelte/legacy-compiler-options,svelte 5,active,2026-08-13
|
|
50
|
+
49,TypeScript,"Use lang=""ts"" in script",TypeScript support,"<script lang=""ts"">",JavaScript for typed projects,"<script lang=""ts"">",<script> with JSDoc,Medium,https://svelte.dev/docs/typescript,svelte 5,active,2026-08-13
|
|
51
|
+
50,TypeScript,Type props with an interface,Explicit prop types for $props,Destructure $props with an interface annotation,Use legacy $$Props or untyped props,"interface Props { name: string }; let { name }: Props = $props()",interface $$Props { name: string },Medium,https://svelte.dev/docs/svelte/typescript#typing-$props,svelte 5,active,2026-08-13
|
|
52
|
+
51,TypeScript,Type legacy events with createEventDispatcher,Type-safe events in legacy components,Retain typed dispatch only for legacy components,Add dispatcher events to runes-mode components,createEventDispatcher<{ save: Data }>(),let { onsave }: Props = $props(),Medium,https://svelte.dev/docs/svelte/svelte#createeventdispatcher,svelte legacy <=4,deprecated,2026-08-13
|
|
53
|
+
52,Accessibility,Use semantic elements,Proper HTML in templates,button nav main appropriately,div for everything,<button onclick={handleClick}>,<div onclick={handleClick}>,High,https://svelte.dev/docs/svelte/compiler-warnings#a11y_click_events_have_key_events,svelte 5,active,2026-08-13
|
|
54
|
+
53,Accessibility,Add aria to dynamic content,Accessible state changes,aria-live for updates,Silent dynamic updates,"<div aria-live=""polite"">{message}</div>",<div>{message}</div>,Medium,,svelte 5,active,2026-08-13
|
|
55
|
+
54,Events,Use event properties in runes mode,Svelte 5 event handlers are component or element properties,Use onclick and callback props for new code,Use on: directives or createEventDispatcher in runes mode,<button onclick={handleClick}>Save</button>,<button on:click={handleClick}>Save</button>,High,https://svelte.dev/docs/svelte/v5-migration-guide#event-changes,svelte 5,active,2026-08-13
|
|
56
|
+
55,SvelteKit,Use $app/state for current app state,SvelteKit exposes page navigating and updated as reactive state,Import current state from $app/state,Start new code with deprecated $app/stores,import { page } from '$app/state',import { page } from '$app/stores',High,https://svelte.dev/docs/kit/$app-state,svelte 5,active,2026-08-13
|