Skip to main content
.fixedSize(axes: { horizontal?: boolean; vertical?: boolean })
axes
{ horizontal?: boolean; vertical?: boolean }
required

Support

Usage

Prevent text from wrapping

Text("This text will not wrap to multiple lines")
    .fixedSize({ horizontal: true, vertical: false })

Fixed size on both axes

Text("Fixed")
    .fixedSize({ horizontal: true, vertical: true })

Allow vertical expansion only

Text("This text can grow taller but stays at proposed width")
    .fixedSize({ horizontal: false, vertical: true })

Notes

fixedSize tells the layout system to use the component’s ideal (intrinsic) size along the specified axes, rather than the size proposed by the parent. This is useful when a parent container would otherwise compress or expand the component. For Text, this prevents line wrapping on the horizontal axis.

See Also