Difference between shared/ui, widgets ? #769
-
I'm new to Feature Sliced Design and so confused between What is the difference between them ? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
Hi, thanks for the question! To give a quick answer — The
Inside the Slices on the Widgets layer then contain segments, for example,
Often the UI code in Widgets imports code from |
Beta Was this translation helpful? Give feedback.
Hi, thanks for the question! To give a quick answer —
shared/ui
contains highly reusable building blocks for UI, whereas widgets are entire meaningful blocks.The
shared/ui/
folder is where you would put components of a UI kit — like MUI or shadcn/ui. For example:shared/ui/Button.tsx
shared/ui/accordion/AccordionItem.vue
Inside the
widgets/
folder, you would put folders called slices. Slices divide your code into independent chunks of code that all relate to a single business goal (for example, a file browser in Google Drive is a single slice, then the file preview is another slice).Slices on the Widgets layer then contain segments, for example,
ui
andapi
. Those allow you to separate…