SwiftUI.js
Components

ContainerRelativeFrame

Sizes content relative to its container using SwiftUI-style count, span, and spacing semantics.

Sizes content relative to its container using SwiftUI-style count, span, and spacing semantics.

Examples

Horizontal

Preview unavailable for this example in the static docs build.

Show code
<HStack spacing={12}>
      <ContainerRelativeFrame count={3} span={1} spacing={12}>
        <Card><Text>1/3</Text></Card>
      </ContainerRelativeFrame>
      <ContainerRelativeFrame count={3} span={2} spacing={12}>
        <Card><Text>2/3</Text></Card>
      </ContainerRelativeFrame>
    </HStack>

Vertical sizing

Preview unavailable for this example in the static docs build.

Show code
<VStack spacing={12}>
      <ContainerRelativeFrame axis="vertical" length={120}>
        <Card><Text>120px tall</Text></Card>
      </ContainerRelativeFrame>
      <ContainerRelativeFrame axis="vertical" length={180}>
        <Card><Text>180px tall</Text></Card>
      </ContainerRelativeFrame>
    </VStack>

API

PropTypeRequiredDescription
alignmentEAlignmentNoNo description yet.
axis'horizontal' | 'vertical' | 'both'NoNo description yet.
countnumberNoNo description yet.
lengthnumber | stringNoNo description yet.
spacingnumberNoNo description yet.
spannumberNoNo description yet.

Inherits additional props from IBaseComponent.