# Gap Utilities for controlling the spacing between grid and flex items. **Category:** Utilities **Storybook:** https://doc.ux4g.gov.in/web/?path=/story/ux4g-utilities-gap--introduction ## Variants documented in Storybook - GapShowcase: https://doc.ux4g.gov.in/web/?path=/story/ux4g-utilities-gap--gapshowcase ## Framework setup ### HTML / CDN ```html ``` ### React ```bash npm install ux4g-web-components ``` ```jsx import 'ux4g-web-components/styles.css'; import 'ux4g-web-components/design-system'; ``` ### Angular Update `angular.json`: ```json { "styles": [ "node_modules/ux4g-web-components/styles/ux4g.css", "src/styles.css" ], "scripts": [ "node_modules/ux4g-web-components/dist/runtime/design-system.js" ] } ``` ## Code examples The snippets below are extracted from the Storybook canvas for Gap. Each example shows the rendered HTML, the equivalent React JSX, and the Angular template markup. ### 1. Gap Showcase — Section Gap (Layout Spacing) HTML: ```html
A complete reference of all gap (section, stack, and inline) utility classes.
Every class from the utility library, categorized for easy access.
Format: ux4g-gap-{size}
|
Gap None (0px)
ux4g-gap-none
|
|
Gap Extra Small (24px)
ux4g-gap-xs
|
|
Gap Small (32px)
ux4g-gap-s
|
|
Gap Medium (48px)
ux4g-gap-m
|
|
Gap Large (56px)
ux4g-gap-l
|
|
Gap Extra Large (64px)
ux4g-gap-xl
|
|
Gap 2X Large (80px)
ux4g-gap-2xl
|
Format: ux4g-gap-{breakpoint}-{size}
|
Gap SM None (0px)
ux4g-gap-sm-none
|
|
Gap SM Small (32px)
ux4g-gap-sm-s
|
|
Gap SM Medium (48px)
ux4g-gap-sm-m
|
|
Gap SM Large (56px)
ux4g-gap-sm-l
|
|
Gap SM Extra Large (64px)
ux4g-gap-sm-xl
|
|
Gap SM 2X Large (80px)
ux4g-gap-sm-2xl
|
|
Gap MD None (0px)
ux4g-gap-md-none
|
|
Gap MD Small (32px)
ux4g-gap-md-s
|
|
Gap MD Medium (48px)
ux4g-gap-md-m
|
|
Gap MD Large (56px)
ux4g-gap-md-l
|
|
Gap MD Extra Large (64px)
ux4g-gap-md-xl
|
|
Gap LG None (0px)
ux4g-gap-lg-none
|
|
Gap LG Small (32px)
ux4g-gap-lg-s
|
|
Gap LG Medium (48px)
ux4g-gap-lg-m
|
|
Gap LG Large (56px)
ux4g-gap-lg-l
|
|
Gap LG Extra Large (64px)
ux4g-gap-lg-xl
|
|
Gap XL None (0px)
ux4g-gap-xl-none
|
|
Gap XL Medium (48px)
ux4g-gap-xl-m
|
|
Gap XL Large (56px)
ux4g-gap-xl-l
|
|
Gap XL Extra Large (64px)
ux4g-gap-xl-xl
|
|
Gap XL 2X Large (80px)
ux4g-gap-xl-2xl
|
Format: ux4g-stack-gap-{size}
|
Stack Gap None (0px)
ux4g-stack-gap-none
|
|
Stack Gap 2X Small (4px)
ux4g-stack-gap-2xs
|
|
Stack Gap Extra Small (8px)
ux4g-stack-gap-xs
|
|
Stack Gap Small (12px)
ux4g-stack-gap-s
|
|
Stack Gap Medium (16px)
ux4g-stack-gap-m
|
|
Stack Gap Large (24px)
ux4g-stack-gap-l
|
Format: ux4g-inline-gap-{size}
|
Inline Gap None (0px)
ux4g-inline-gap-none
|
|
Inline Gap 2X Small (2px)
ux4g-inline-gap-2xs
|
|
Inline Gap Extra Small (4px)
ux4g-inline-gap-xs
|
|
Inline Gap Small (8px)
ux4g-inline-gap-s
|
|
Inline Gap Medium (12px)
ux4g-inline-gap-m
|
|
Inline Gap Large (16px)
ux4g-inline-gap-l
|
A complete reference of all gap (section, stack, and inline) utility classes.
Every class from the utility library, categorized for easy access.
Format:
ux4g-gap-{size}
|
Gap None
(0px)
ux4g-gap-none
|
|
Gap Extra Small
(24px)
ux4g-gap-xs
|
|
Gap Small
(32px)
ux4g-gap-s
|
|
Gap Medium
(48px)
ux4g-gap-m
|
|
Gap Large
(56px)
ux4g-gap-l
|
|
Gap Extra Large
(64px)
ux4g-gap-xl
|
|
Gap 2X Large
(80px)
ux4g-gap-2xl
|
Format:
ux4g-gap-{breakpoint}-{size}
|
Gap SM None
(0px)
ux4g-gap-sm-none
|
|
Gap SM Small
(32px)
ux4g-gap-sm-s
|
|
Gap SM Medium
(48px)
ux4g-gap-sm-m
|
|
Gap SM Large
(56px)
ux4g-gap-sm-l
|
|
Gap SM Extra Large
(64px)
ux4g-gap-sm-xl
|
|
Gap SM 2X Large
(80px)
ux4g-gap-sm-2xl
|
|
Gap MD None
(0px)
ux4g-gap-md-none
|
|
Gap MD Small
(32px)
ux4g-gap-md-s
|
|
Gap MD Medium
(48px)
ux4g-gap-md-m
|
|
Gap MD Large
(56px)
ux4g-gap-md-l
|
|
Gap MD Extra Large
(64px)
ux4g-gap-md-xl
|
|
Gap LG None
(0px)
ux4g-gap-lg-none
|
|
Gap LG Small
(32px)
ux4g-gap-lg-s
|
|
Gap LG Medium
(48px)
ux4g-gap-lg-m
|
|
Gap LG Large
(56px)
ux4g-gap-lg-l
|
|
Gap LG Extra Large
(64px)
ux4g-gap-lg-xl
|
|
Gap XL None
(0px)
ux4g-gap-xl-none
|
|
Gap XL Medium
(48px)
ux4g-gap-xl-m
|
|
Gap XL Large
(56px)
ux4g-gap-xl-l
|
|
Gap XL Extra Large
(64px)
ux4g-gap-xl-xl
|
|
Gap XL 2X Large
(80px)
ux4g-gap-xl-2xl
|
Format:
ux4g-stack-gap-{size}
|
Stack Gap None
(0px)
ux4g-stack-gap-none
|
|
Stack Gap 2X Small
(4px)
ux4g-stack-gap-2xs
|
|
Stack Gap Extra Small
(8px)
ux4g-stack-gap-xs
|
|
Stack Gap Small
(12px)
ux4g-stack-gap-s
|
|
Stack Gap Medium
(16px)
ux4g-stack-gap-m
|
|
Stack Gap Large
(24px)
ux4g-stack-gap-l
|
Format:
ux4g-inline-gap-{size}
|
Inline Gap None
(0px)
ux4g-inline-gap-none
|
|
Inline Gap 2X Small
(2px)
ux4g-inline-gap-2xs
|
|
Inline Gap Extra Small
(4px)
ux4g-inline-gap-xs
|
|
Inline Gap Small
(8px)
ux4g-inline-gap-s
|
|
Inline Gap Medium
(12px)
ux4g-inline-gap-m
|
|
Inline Gap Large
(16px)
ux4g-inline-gap-l
|
A complete reference of all gap (section, stack, and inline) utility classes.
Every class from the utility library, categorized for easy access.
Format: ux4g-gap-{size}
|
Gap None (0px)
ux4g-gap-none
|
|
Gap Extra Small (24px)
ux4g-gap-xs
|
|
Gap Small (32px)
ux4g-gap-s
|
|
Gap Medium (48px)
ux4g-gap-m
|
|
Gap Large (56px)
ux4g-gap-l
|
|
Gap Extra Large (64px)
ux4g-gap-xl
|
|
Gap 2X Large (80px)
ux4g-gap-2xl
|
Format: ux4g-gap-{breakpoint}-{size}
|
Gap SM None (0px)
ux4g-gap-sm-none
|
|
Gap SM Small (32px)
ux4g-gap-sm-s
|
|
Gap SM Medium (48px)
ux4g-gap-sm-m
|
|
Gap SM Large (56px)
ux4g-gap-sm-l
|
|
Gap SM Extra Large (64px)
ux4g-gap-sm-xl
|
|
Gap SM 2X Large (80px)
ux4g-gap-sm-2xl
|
|
Gap MD None (0px)
ux4g-gap-md-none
|
|
Gap MD Small (32px)
ux4g-gap-md-s
|
|
Gap MD Medium (48px)
ux4g-gap-md-m
|
|
Gap MD Large (56px)
ux4g-gap-md-l
|
|
Gap MD Extra Large (64px)
ux4g-gap-md-xl
|
|
Gap LG None (0px)
ux4g-gap-lg-none
|
|
Gap LG Small (32px)
ux4g-gap-lg-s
|
|
Gap LG Medium (48px)
ux4g-gap-lg-m
|
|
Gap LG Large (56px)
ux4g-gap-lg-l
|
|
Gap LG Extra Large (64px)
ux4g-gap-lg-xl
|
|
Gap XL None (0px)
ux4g-gap-xl-none
|
|
Gap XL Medium (48px)
ux4g-gap-xl-m
|
|
Gap XL Large (56px)
ux4g-gap-xl-l
|
|
Gap XL Extra Large (64px)
ux4g-gap-xl-xl
|
|
Gap XL 2X Large (80px)
ux4g-gap-xl-2xl
|
Format: ux4g-stack-gap-{size}
|
Stack Gap None (0px)
ux4g-stack-gap-none
|
|
Stack Gap 2X Small (4px)
ux4g-stack-gap-2xs
|
|
Stack Gap Extra Small (8px)
ux4g-stack-gap-xs
|
|
Stack Gap Small (12px)
ux4g-stack-gap-s
|
|
Stack Gap Medium (16px)
ux4g-stack-gap-m
|
|
Stack Gap Large (24px)
ux4g-stack-gap-l
|
Format: ux4g-inline-gap-{size}
|
Inline Gap None (0px)
ux4g-inline-gap-none
|
|
Inline Gap 2X Small (2px)
ux4g-inline-gap-2xs
|
|
Inline Gap Extra Small (4px)
ux4g-inline-gap-xs
|
|
Inline Gap Small (8px)
ux4g-inline-gap-s
|
|
Inline Gap Medium (12px)
ux4g-inline-gap-m
|
|
Inline Gap Large (16px)
ux4g-inline-gap-l
|