Border is a .NET MAUI view that wraps one child view, draws an outline around it, and creates a visual container for content. section 4.4.3
Configure the border with these properties:
- Set Stroke to a Brush, using a solid color, linear gradient, radial gradient, hex value, or resource. section 4.4.3
- Set StrokeThickness to control outline width in device-independent units. section 4.4.3
- Set StrokeShape to Rectangle, Ellipse, RoundRectangle, Path, Polygon, Polyline, or a line. section 4.4.3
Create a card in MauiTodo
Wrap the to-do item Grid in a Border, use a three-unit stroke, and choose a rounded rectangle with a ten-unit corner radius. The result separates each item visually and supports tighter list spacing. A Shadow can be added to the same Border for depth.
Use borders for selectable content
In a movie interface, wrap the genre-selection area in a rounded Border and place a tap gesture recognizer on its child layout. The same pattern creates compact, visually distinct interface regions. section 6.2.1
