It sounds like the issue is likely related to how v0 parses registry items rather than a problem with your shadcn/ui component itself. A few developers have reported similar behavior where the files.content field appears to get truncated, especially when the component contains more complex styling logic (for example multiple variants, sizes, or extended cva configurations).
One possible reason is that v0 tries to normalize or reinterpret the component structure during import, and if the registry payload is large or formatted in a way the parser doesn’t fully expect, parts of the code (like additional size definitions) may get dropped. When that happens, v0 often recreates the missing parts using its own assumptions, which explains why the sizing behaves differently after import.
A few things that might help avoid the problem:
-
Move variant/size logic into a separate utility file instead of keeping everything inside the component.
-
Reduce the size of the files.content payload if the registry entry is very large.
-
Ensure the registry file follows the standard shadcn registry structure without extra formatting or nested logic that the importer might misinterpret.
-
If possible, split larger components into smaller registry items, which tends to import more reliably.
At the moment, until the import behavior improves, restructuring the component or simplifying the styling logic is often the most practical workaround. It might also be worth reporting it to the v0 registry/import system maintainers, since it looks more like a parser limitation than a component issue.