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

Attribute
Type
Default
Description

data-type

string

-

Must be "container"

Supported Tags

HTML Elements

  • div

  • span

  • p

SVG Elements

  • svg

  • g

Examples

Basic HTML Container

SVG Container

Nested Containers

Layout Patterns

Centered Layout

Grid 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 correctly

  • Verify 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


Last updated