SwiftUI.js
Components

Grid

Grid arranges content in explicit rows and columns, following SwiftUI's non-lazy grid model.

Grid arranges content in explicit rows and columns, following SwiftUI's non-lazy grid model.

Examples

Default

Preview unavailable for this example in the static docs build.

Show code
<Grid columns={2} spacing={12}>
      <GridRow>
        <Card><Text>One</Text></Card>
        <Card><Text>Two</Text></Card>
      </GridRow>
      <GridRow>
        <Card><Text>Three</Text></Card>
        <Card><Text>Four</Text></Card>
      </GridRow>
    </Grid>

API

PropTypeRequiredDescription
columnsnumberNoNumber of columns in the grid. Default: 1
spacingnumberNoSpacing between rows and columns, in pixels. Default: 0

Inherits additional props from IBaseComponent.

Overview

Grid arranges content in explicit rows and columns, following SwiftUI's non-lazy grid model.

On this page