Skip to content

Responsive Design

SenangStart uses mobile-first responsive prefixes.

Breakpoints

PrefixMin-WidthDevice
(none)0pxMobile (default)
mob:480pxLarge mobile
tab:768pxTablet
lap:1024pxLaptop
desk:1280pxDesktop

Usage

Add breakpoint prefixes to any space or layout value:

html
<div space="p:small tab:p:medium lap:p:big">
  <!-- Small padding on mobile -->
  <!-- Medium padding on tablet+ -->
  <!-- Big padding on laptop+ -->
</div>

Common Patterns

Responsive Padding

html
<section space="p:medium tab:p:big desk:p:giant">
  Content with progressive padding
</section>

Responsive Layout

html
<div layout="flex col tab:row">
  <!-- Stacked on mobile, horizontal on tablet+ -->
  <div>Item 1</div>
  <div>Item 2</div>
</div>

Responsive Grid

html
<div
  layout="grid"
  space="g:small tab:g:medium"
  style="grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));"
>
  <div>Card 1</div>
  <div>Card 2</div>
  <div>Card 3</div>
</div>

Hide on Mobile

html
<nav layout="hidden tab:flex">
  <!-- Hidden on mobile, flex on tablet+ -->
</nav>

Mobile Navigation

html
<!-- Mobile menu button -->
<button layout="block tab:hidden">☰ Menu</button>

<!-- Desktop navigation -->
<nav layout="hidden tab:flex" space="g:medium">
  <a>Home</a>
  <a>About</a>
  <a>Contact</a>
</nav>

Full Responsive Example

html
<div
  layout="flex col lap:row"
  space="p:medium tab:p:big gap:medium tab:gap:big"
>
  <!-- Sidebar -->
  <aside
    space="w:[100%] lap:w:[300px]"
    visual="bg:light"
  >
    Sidebar content
  </aside>
  
  <!-- Main content -->
  <main space="w:[100%] lap:w:[calc(100%-300px)]">
    Main content
  </main>
</div>

Custom Breakpoints

Override in senangstart.config.js:

javascript
export default {
  theme: {
    screens: {
      'mob': '480px',
      'tab': '768px',
      'lap': '1024px',
      'desk': '1280px',
      'wide': '1536px'  // Add custom breakpoint
    }
  }
}

Use your custom breakpoint:

html
<div space="p:big wide:p:giant">
  Extra large padding on wide screens
</div>

Tailwind Compatibility

SenangStart supports Tailwind CSS default breakpoints out-of-the-box using the tw- prefix. This is useful when migrating from Tailwind or when you prefer Tailwind's breakpoint scale.

PrefixMin-WidthTailwind Equiv.
tw-sm:640pxsm:
tw-md:768pxmd:
tw-lg:1024pxlg:
tw-xl:1280pxxl:
tw-2xl:1536px2xl:

Usage with Tailwind Scale

You can combine tw- prefixed breakpoints with Tailwind-style values (also prefixed with tw-):

html
<div 
  space="p:tw-4 tw-md:p:tw-8" 
  visual="rounded:tw-lg tw-lg:shadow:tw-xl"
>
  Tailwind-compatible scaling
</div>