Layout

HeroUI provides layout customization options for spacing, fonts, and other visual properties. Layout tokens help maintain consistency across components without modifying Tailwind CSS defaults.

Layout options are applied to all components.

Default Layout

Default values for the layout tokens are:

CSS Variables

HeroUI creates CSS variables using the format --prefix-prop-name-scale for each layout token. By default the prefix is heroui, but you can change it with the prefix option.

Then you can use the CSS variables in your CSS files.

API Reference

AttributeTypeDescription
hoverOpacitystring, numberA number between 0 and 1 that is applied as opacity-[value] when the component is hovered.
disabledOpacitystring, numberA number between 0 and 1 that is applied as opacity-[value] when the component is disabled.
dividerWeightstringThe default height applied to the divider component. We recommend to use px units.
fontSizeFontThemeUnitThe default font size applied across the components.
lineHeightFontThemeUnitThe default line height applied across the components.
radiusBaseThemeUnitThe default radius applied across the components. We recommend to use rem units.
borderWidthBaseThemeUnitThe border width applied across the components.
boxShadowBaseThemeUnitThe box shadow applied across the components.

BaseThemeUnit

FontThemeUnit