Skip to content

Spacing

Bumi uses a 4px base unit. Every margin, padding, and gap should be a multiple of 4. This creates a consistent vertical and horizontal rhythm across all components.

Base Unit

1 unit = 4px

Spacing Scale

TokenpxremCommon Usage
space-14px0.25Tight gaps (icon-to-text in badges)
space-28px0.5Default icon-to-text gap, inline spacing
space-312px0.75Input internal padding (vertical), list item gap
space-416px1.0Card internal gaps, button horizontal padding
space-520px1.25Card padding, page padding (mobile)
space-624px1.5Section sub-gaps, form field spacing
space-832px2.0Section gaps, card-to-card spacing
space-1040px2.5Page padding (desktop), major section gap
space-1248px3.0Major section separators
space-1664px4.0Page-level vertical spacing
Spacing Scale
4
8
12
16
20
24
32
40
48
64

Component Padding

ComponentPaddingCSS
Card20pxpadding: 20px
Button (default)8px 16pxpadding: 8px 16px
Button (small)6px 12pxpadding: 6px 12px
Button (large)12px 24pxpadding: 12px 24px
Input10px 14pxpadding: 10px 14px
Badge / Pill2px 8pxpadding: 2px 8px
Table cell12px 16pxpadding: 12px 16px
Modal body24pxpadding: 24px
Dropdown item8px 12pxpadding: 8px 12px

Section Gaps

ContextGap
Between cards in a grid16px (gap: 16px)
Between sections on a page32px
Between major page regions48px
Between form fields24px

Page Padding

PlatformValue
Desktop web40px
Tablet24px
Mobile web / React Native20px
StateWidth
Expanded240px
Collapsed64px (icon-only)

Border Radius

TokenpxUsage
radius-sm6pxBadges, pills, small tags
radius-md8pxButtons, inputs, dropdowns
radius-lg12pxCards, panels
radius-xl14pxMobile cards, floating shell
radius-2xl16pxModals, bottom sheets
radius-3xl20pxMember card, special cards
radius-full44pxPhone frame mock, avatar circles
Border Radius Preview
sm
6px
md
8px
lg
12px
xl
14px
2xl
16px
3xl
20px
full
44px

The Floating Shell

The floating shell is the signature RetailOS layout. The app sits inside a container with outer margin and rounded corners.

css
.floating-shell {
  margin: 12px;           /* Outer margin on all sides */
  border-radius: 14px;    /* Rounded corners */
  overflow: hidden;
  /* Shadow applied separately --- see Elevation */
}

CSS Custom Properties

css
:root {
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;
  --space-12: 48px;
  --space-16: 64px;

  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 14px;
  --radius-2xl: 16px;
  --radius-3xl: 20px;
  --radius-full: 44px;

  --sidebar-width: 240px;
  --sidebar-collapsed: 64px;
  --page-padding: 40px;
}

@media (max-width: 1024px) {
  :root { --page-padding: 24px; }
}
@media (max-width: 640px) {
  :root { --page-padding: 20px; }
}

DO and DON'T

DO

  • Always use multiples of 4px for spacing
  • Use the token names in code, not raw pixel values
  • Keep card padding at 20px consistently across all apps
  • Use gap (flexbox/grid) instead of margins between siblings

DON'T

  • Don't use odd pixel values (13px, 17px, 22px) for spacing
  • Don't mix padding conventions within the same component type
  • Don't reduce card padding below 16px even on mobile --- the content needs room to breathe
  • Don't use negative margins to compensate for inconsistent spacing

RetailOS - Sistem ERP Retail Modern untuk Indonesia