web icon indicating copy to clipboard operation
web copied to clipboard

Components: components need the library base styles to render correctly

Open printerscanner opened this issue 1 year ago • 2 comments

When installing some components on a fresh shadcn project, the component doesn't render correctly due to a missing style file from the library.

Suggestion: Add missing stylesheet import '@xyflow/react/dist/style.css';. This may not be necessary for some of the custom components.

printerscanner avatar Nov 13 '24 16:11 printerscanner

Is this still an issue @peterkogo @printerscanner ?

moklick avatar Mar 28 '25 20:03 moklick

Yes, but the question is should we add it to each component that needs it and have redundancy or put it in bold somewhere in a tutorial that you need to have your styles imported for components to work.

printerscanner avatar Apr 01 '25 14:04 printerscanner

made a sandbox to check it out, its looking alright with a base node when importing "@xyflow/react/dist/style.css"; in the main app file

https://codesandbox.io/p/github/0x0f0f0f/component-style-test/main?import=true

put it in bold somewhere in a tutorial that you need to have your styles imported for components to work.

I think we should add it to the main readme.

I don't expect a lot of people using our components outside of a react flow, but still worth noting down.

0x0f0f0f avatar Oct 21 '25 11:10 0x0f0f0f