Container Widget
The Container Widget groups elements together and provides layout structure. It supports both HTML and SVG elements, making it the foundation for organizing your template content.
Basic Usage
<div data-type="container" class="flex items-center justify-center w-full h-full">
<div data-type="text" class="text-2xl">Content inside container</div>
</div>Attributes
data-type
string
-
Must be "container"
Supported Tags
HTML Elements
divspanp
SVG Elements
svgg
Examples
Basic HTML Container
SVG Container
Nested Containers
Layout Patterns
Centered Layout
Grid Layout
Sidebar Layout
SVG Container Examples
Simple SVG
Complex SVG Layout
Styling Options
Background Colors
Layout Classes
Spacing
Common Use Cases
Dashboard Layout
Card Layout
Hero Section
Best Practices
Structure
Use containers for grouping: Group related elements together
Nest appropriately: Don't over-nest containers
Clear hierarchy: Maintain a clear visual hierarchy
Consistent spacing: Use consistent margins and padding
Performance
Minimize nesting: Avoid unnecessary container nesting
Efficient layouts: Use appropriate layout methods
Clean markup: Keep HTML structure clean and semantic
Accessibility
Semantic structure: Use appropriate HTML elements
Clear organization: Organize content logically
Proper contrast: Ensure good color contrast
Readable text: Use appropriate font sizes and weights
Troubleshooting
Container Not Displaying
Problem: Container doesn't appear or content is missing
Solutions:
Check that
data-type="container"is set correctlyVerify the container has proper dimensions (w-full h-full)
Ensure child elements are properly positioned
Check for CSS conflicts
Layout Issues
Problem: Elements not positioning correctly
Solutions:
Use appropriate positioning classes (absolute, relative)
Check that parent container has proper dimensions
Verify flexbox or grid classes are correct
Test different layout approaches
SVG Not Rendering
Problem: SVG elements don't display
Solutions:
Ensure SVG has proper viewBox attribute
Check that SVG dimensions are set
Verify SVG content is valid
Use appropriate SVG positioning
Styling Problems
Problem: CSS styles not applying correctly
Solutions:
Check that Tailwind classes are correct
Verify CSS specificity
Test with inline styles
Ensure proper class ordering
Related Widgets
Text Widget - For text content inside containers
Image Widget - For images inside containers
Counter Widget - For animated numbers inside containers
Last updated