GridLayout

A grid that you can use in conditional layouts.

ComponentiOS 16.0+macOS 13.0+tvOS 16.0+watchOS 9.0+GridLayout in SwiftUI

Declaration

React
import { GridLayout } from 'swiftui-react-native';
Swift
@frozen nonisolated struct GridLayout

Initializers

One SwiftUI initializer backs <GridLayout>.

React
<GridLayout
  alignment?: SwiftUI.Alignment
  horizontalSpacing?: number | null
  verticalSpacing?: number | null
>
  children?: ReactNode
</GridLayout>
Swift
nonisolated init(
    alignment: Alignment = .center,
    horizontalSpacing: CGFloat? = nil,
    verticalSpacing: CGFloat? = nil
)
  • childrenReactNode

    The views this layout arranges.

  • The guide for aligning subviews within the space allocated for a given cell. The default is Alignment/center.

    Default `.center`

  • horizontalSpacingnumber | null

    The horizontal distance between each cell, given in points. The value is nil by default, which results in a default distance between cells that's appropriate for the platform.

    Default `nil`

  • verticalSpacingnumber | null

    The vertical distance between each cell, given in points. The value is nil by default, which results in a default distance between cells that's appropriate for the platform.

    Default `nil`

Also takes the common view props: modifiers, style and testID.

See also

More in Layout.