Tailwind CSS IntelliSense gives no class suggestions in a React project
No class name completions while typing inside classNameShort answer
The extension needs to find your Tailwind setup first. For Tailwind 4 it looks for a CSS file that imports tailwindcss; for Tailwind 3 it needs a tailwind.config file. If it cannot find one, it stays silent. Open its output log, then fix detection, exclusions or the editor settings.
Fix it fast
1Find out which cause you have
Open the command palette and run Tailwind CSS: Show Output. The language server prints what it found and what failed.
Tailwind CSS: Show Output2Match what you see, then jump to its fix
- 1
The output log shows no project or config foundtailwindcss is not installed in the workspace, or the CSS entry file is missingFix - 2
Several stylesheets or several Tailwind installs in a monorepoAuto-detection picked the wrong CSS file or configFix - 3
The entry file exists but the output log never mentions itVS Code hides the stylesheet or config from the extensionFix - 4
Completions work in className but not in a helper call or a custom propThe class is not in an attribute or language the extension watches, or string suggestions are offFix
- 1
What does the error look like?
No class name completions while typing inside classNameNo hover preview on Tailwind classes
Cause 1 of 4
tailwindcss is not installed in the workspace, or the CSS entry file is missing
1Check
Version 4 needs a .css file containing an import of tailwindcss, and the package in the folder you opened. Sass, Less and Stylus entry files are not supported.
npm ls tailwindcss
grep -rn "@import \"tailwindcss\"" src/2Fix
Install the package where you opened VS Code, and import it from a plain CSS file.
npm install tailwindcss
/* src/index.css */
@import "tailwindcss";3Verify
Reload the window and type a class in className.
Developer: Reload WindowConfirmed by github.com
Cause 2 of 4
Auto-detection picked the wrong CSS file or config
1Check
With multiple installs, config files or stylesheets importing tailwindcss, the extension cannot tell which one belongs to your app.
grep -rln "tailwindcss" --include=*.css . --exclude-dir=node_modules2Fix
Point the extension at the entry stylesheet with the experimental config file setting.
// .vscode/settings.json
{
"tailwindCSS.experimental.configFile": "src/index.css"
}3Verify
Reload the window and check the output log for the chosen file.
Tailwind CSS: Show OutputConfirmed by github.com
Cause 3 of 4
VS Code hides the stylesheet or config from the extension
1Check
files.exclude, files.watcherExclude and tailwindCSS.files.exclude can all hide it.
grep -n "exclude" .vscode/settings.json2Fix
Remove the entry file's folder from those exclude lists.
// .vscode/settings.json: make sure src/ is not listed
{ "files.exclude": {} }3Verify
Reload and look for the file in the output log.
Developer: Reload WindowConfirmed by github.com
Cause 4 of 4
The class is not in an attribute or language the extension watches, or string suggestions are off
1Check
Only attributes listed in tailwindCSS.classAttributes get completions; the default list is class, className, ngClass and class:list. Completions inside strings also need editor.quickSuggestions to allow strings.
grep -n "classAttributes\|quickSuggestions" .vscode/settings.json2Fix
Add your attribute name, and turn on quick suggestions for strings.
{
"tailwindCSS.classAttributes": ["class", "className", "containerClassName"],
"editor.quickSuggestions": { "strings": "on" }
}3Verify
Type inside the custom attribute.
Developer: Reload WindowConfirmed by github.com
How do I stop it coming back?
- Open VS Code on the folder that holds package.json and the Tailwind CSS entry file.
- Keep the Tailwind entry file a plain .css file.
- Set tailwindCSS.experimental.configFile in monorepos.
Sources
How was this page made?
I drafted this page with AI assistance from the official documents listed under Sources. Every cause above names the document that confirms it. I have not reproduced this fix on a machine of my own yet, so read it as documented guidance, not a test report. Found a mistake? Tell me.
Which stack is behind this page?
Projects of mine built on the same technologies:
- TaxiDexMy own multi-tenant taxi dispatch SaaS: API, dispatcher portal, driver and passenger apps, and the servers underneath.
- QistLockA NestJS and React SaaS driving an Android Device Owner agent that locks financed phones when payments lapse.
- TaskvareA task and project-management suite: React on the web, Flutter on mobile, TypeScript underneath.
Related fixes
Web apps
There is no tailwind.config.js after installing Tailwind 4 and HeroUI in Next.js
HeroUI components render unstyled
Nothing is broken: Tailwind CSS 4 is configured in CSS and no longer creates tailwind.config.js.
3 causes, each with a fixWeb apps
Hydration failed after adding next-themes dark mode
Console reports a server and client mismatch on the html element
next-themes changes the html element and knows the theme only in the browser, so server HTML and client HTML differ.
3 causes, each with a fixWeb apps
TypeScript marks className as an error on React Native components
Property 'className' does not exist on type
React Native components have no className prop in their own types.
3 causes, each with a fixWeb apps
A shadcn/ui Dialog stays open after the form is submitted
Form submits and the data saves, but the modal remains on screen
A shadcn Dialog is a Radix dialog.
3 causes, each with a fixWeb apps
shadcn/ui setup fails in a Vite React project using Tailwind v4
Imports from @/components/ui do not resolve in the editor or the build
shadcn init needs three things in a Vite project: Tailwind v4 installed with the @tailwindcss/vite plugin and a single @import "tailwindcss" line in your CSS, the @/* path alias in both tsconfig.json and tsconfig.app.json, and the same alias in vite.config.ts, with @types/node installed so path resolves.
4 causes, each with a fixWeb apps
A Tailwind class with square brackets produces no CSS or the wrong CSS
A class built on a CSS variable, such as text-[var(--size)], generates the wrong property or nothing
Tailwind turns a class in square brackets into CSS only when the whole string is in a scanned file and the value is valid.
3 causes, each with a fix