Skip to content

Difference between shared/ui, widgets ? #769

Closed Answered by illright
toothlessdev asked this question in Q&A
Discussion options

You must be logged in to vote

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 and api. Those allow you to separate…

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@toothlessdev
Comment options

Answer selected by illright
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants