Freedom

Box

·   1 min ·   Gautham Chettiar

Wraps content in a container with configurable width, alignment, and optional border.

Location : layouts/_partials/layouts/box.html

Parameters :

ParameterTypeDescriptionDefault
contentstringHTML content to wraprequired
widthstringWidth mode: "compact" (fit content), "full" (page width), "wide" (viewport width)"compact"
alignstringAlignment: "left", "center", "right""left"
borderbooleanAdd border with paddingfalse
classstringAdditional CSS classes-

Examples:

go
// Basic usage (compact, left-aligned)
{{ $content := "<p>Some content</p>" }}
{{ partial "layouts/box.html" (dict "content" $content) }}

// Full width, centered
{{ $content := "<p>Some content</p>" }}
{{ partial "layouts/box.html" (dict 
  "content" $content 
  "width" "full" 
  "align" "center"
) }}

// Wide with border
{{ $content := "<p>Some content</p>" }}
{{ partial "layouts/box.html" (dict 
  "content" $content 
  "width" "wide" 
  "border" true
) }}

// Custom class
{{ $content := "<p>Some content</p>" }}
{{ partial "layouts/box.html" (dict 
  "content" $content 
  "class" "custom-box"
) }}