Articles in this section
Category / Section

How to set the border color and width of a Card in the .NET MAUI Cards?

3 mins read

The Syncfusion® .NET MAUI Cards control allows you to set the border color and width of a card. This article will guide you on how to customize the card by setting its border color and border width.

Implementation Steps:

Define a StackLayout (or any other layout) containing the SfCardLayout and set its SwipeDirection to Left to swipe the cards to the left. For each card, initialize an SfCardView and set the border color using the BorderColor property and the border width using the BorderWidth property.

XAML

<StackLayout>
   <cards:SfCardLayout HeightRequest="700"
                       SwipeDirection="Left">
       <cards:SfCardView BackgroundColor="Orange"
                         BorderColor="Black"
                         BorderWidth="5">
           <Label HorizontalTextAlignment="Center"
                  VerticalTextAlignment="Center"
                  Text="Orange" />
       </cards:SfCardView>
       <cards:SfCardView BackgroundColor="BlueViolet"
                         BorderColor="Black"
                         BorderWidth="5">
           <Label HorizontalTextAlignment="Center"
                  VerticalTextAlignment="Center"
                  Text="Violet" />
       </cards:SfCardView>
   </cards:SfCardLayout>
</StackLayout>

Download the complete sample from GitHub.

Output:

CardCustomization.png

Conclusion:

I hope you enjoyed learning how to set the border color and width of a card in .NET MAUI Cards (SfCards).

You can refer to our .NET MAUI Card feature tour page to learn about its other groundbreaking feature representations. Explore our .NET MAUI Cards documentation to understand how to present and manipulate data.

For current customers, you can check out our .NET MAUI from the License and Downloads page. If you are new to Syncfusion®, try our 30-day free trial to check out our .NET MAUI Cards and other .NET MAUI components.

Please let us know in the comments section if you have any queries or require clarification. You can also contact us through our support forums, Direct-Trac, or feedback portal. We are always happy to assist you!

Did you find this information helpful?
Yes
No
Help us improve this page
Please provide feedback or comments
Comments (0)
Please  to leave a comment
Access denied
Access denied