Declaration
import { GridLayout } from 'swiftui-react-native';@frozen nonisolated struct GridLayoutInitializers
One SwiftUI initializer backs <GridLayout>.
<GridLayout
alignment?: SwiftUI.Alignment
horizontalSpacing?: number | null
verticalSpacing?: number | null
>
children?: ReactNode
</GridLayout>nonisolated init(
alignment: Alignment = .center,
horizontalSpacing: CGFloat? = nil,
verticalSpacing: CGFloat? = nil
)childrenReactNodeThe views this layout arranges.
alignmentSwiftUI.AlignmentThe guide for aligning subviews within the space allocated for a given cell. The default is
Alignment/center.Default
`.center`horizontalSpacingnumber | nullThe horizontal distance between each cell, given in points. The value is
nilby default, which results in a default distance between cells that's appropriate for the platform.Default
`nil`verticalSpacingnumber | nullThe vertical distance between each cell, given in points. The value is
nilby 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.
- AnyLayoutA type-erased instance of the layout protocol.
- GeometryReaderA container view that defines its content as a function of its own size and coordinate space.
- GlassEffectContainerA view that combines multiple glass shapes into a single shape that can morph individual shapes into one another.
- GridA container view that arranges other views in a two dimensional layout.
- GridRowA horizontal row in a two dimensional grid container.
- HStackA view that arranges its subviews in a horizontal line.
- HStackLayoutA horizontal container that you can use in conditional layouts.
- LazyHGridA container view that arranges its child views in a grid that grows horizontally, creating items only as needed.
- LazyHStackA view that arranges its children in a line that grows horizontally, creating items only as needed.
- LazyVGridA container view that arranges its child views in a grid that grows vertically, creating items only as needed.
- LazyVStackA view that arranges its children in a line that grows vertically, creating items only as needed.
- ScrollViewA scrollable view.