Tutorials

How to align content

When the received content is smaller than the container element, it can be aligned within the container. In this example, the width of the teaser is constrained by the maxWidth setting, making it narrower than the container on screens that are wide enough. The alignX setting determines the alignment.

Setup
adk.config()
    .addTemplate('com.advisible.native.teaser', adk.template.config()
        .url('/teaser.html'))

    .addContainer('native-teaser', adk.container.config()
        .maxWidth(300)
        .alignX('left'))
Result