Customizing Screens - Horizon UI

Customize the default breakpoints for Horizon UI and add your own custom breakpoints that you like to have for your project.



Default Screens

Horizon UI provides a set of default breakpoints for different screen sizes that you can use.

const screens = {
  sm: "576px",
  "sm-max": { max: "576px" },
  md: "768px",
  "md-max": { max: "768px" },
  lg: "992px",
  "lg-max": { max: "992px" },
  xl: "1200px",
  "xl-max": { max: "1200px" },
  "2xl": "1320px",
  "2xl-max": { max: "1320px" },
  "3xl": "1600px",
  "3xl-max": { max: "1600px" },
  "4xl": "1850px",
  "4xl-max": { max: "1850px" },
};

Customize the Default Breakpoints

You can customize the default breakpoints for Horizon UI very easy and straightforward, it's the same as customizing breakpoints for tailwindcss.

You just need to customize the breakpoint that you like through the screens object for tailwind.config.js file.

module.exports = {
  theme: {
    screens: {
      sm: "640px",
      // rest of the breakpoints
    },
  },
};

Adding New Breakpoint

You can add new breakpoint for Horizon UI very easy and straightforward, it's the same as adding new breakpoint for tailwindcss.

You just need to add your own breakpoint to the extend and screens object for tailwind.config.js file.

module.exports = {
  theme: {
    extend: {
      screens: {
        "3xl": "1600px",
      },
    },
  },
};



For more information about Tailwind CSS React breakpoints customization, please check the Tailwind CSS React Documentation.