Skip to content

How can I customize the default spacing between components in shadcn to fit my design? #6049

Answered by georgeeburt
desiah asked this question in Q&A
Discussion options

You must be logged in to vote

You can customise the default spacing globally in shadcn by extending the tailwind CSS configuration file (tailwind.config.js) since shadcn is built on tailwind.

Here is a simple example:

module.exports = {
  theme: {
    extend: {
      spacing: {
        'custom-1': '4px',
        'custom-2': '8px',
        // Add more as needed
      },
    },
  },
};

Hope this helps.

Replies: 1 comment 1 reply

Comment options

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

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