Problem
Card defaults to Width = Size.Full() (100% width) in its constructor (src/Ivy/Widgets/Card.cs:27). When multiple Cards are placed inside Layout.Horizontal(), they each take 100% width and stack vertically instead of appearing side-by-side.
This is a common pitfall — agents and new users frequently place Cards in horizontal layouts and get unexpected stacking behavior.
Screenshots
See session 55e7f454-675e-4e7f-b29e-e93134530200 for visual evidence.
Possible Solutions
-
Change default to Size.Fraction(1) — Cards in horizontal layouts would share space equally by default. This better matches flex-item behavior but is a breaking change for any layout relying on Cards being full-width by default.
-
Keep current default, improve docs — Add FAQ entries explaining the workaround (Width(Size.Fraction(1))). Already done in StackLayout docs.
-
Context-aware default — Card could detect its parent layout orientation and adjust, but this adds complexity.
Questions for Review
- Is
Size.Full() the right default for Card, given that horizontal layouts are a common use case?
- Would changing to
Size.Fraction(1) cause significant breakage?
- Should other widgets with
Size.Full() defaults be reviewed similarly?
Problem
Carddefaults toWidth = Size.Full()(100% width) in its constructor (src/Ivy/Widgets/Card.cs:27). When multiple Cards are placed insideLayout.Horizontal(), they each take 100% width and stack vertically instead of appearing side-by-side.This is a common pitfall — agents and new users frequently place Cards in horizontal layouts and get unexpected stacking behavior.
Screenshots
See session
55e7f454-675e-4e7f-b29e-e93134530200for visual evidence.Possible Solutions
Change default to
Size.Fraction(1)— Cards in horizontal layouts would share space equally by default. This better matches flex-item behavior but is a breaking change for any layout relying on Cards being full-width by default.Keep current default, improve docs — Add FAQ entries explaining the workaround (
Width(Size.Fraction(1))). Already done in StackLayout docs.Context-aware default — Card could detect its parent layout orientation and adjust, but this adds complexity.
Questions for Review
Size.Full()the right default for Card, given that horizontal layouts are a common use case?Size.Fraction(1)cause significant breakage?Size.Full()defaults be reviewed similarly?