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 supports you to set the border color and border width of the card. In this article, you will learn to customize the card by setting the border color and border width of the card.

Define a StackLayout (or any layout) containing SfCardLayout, and set its SwipeDirection to Left to swipe the cards to the left. Initialize the SfCardView for each card and set the border color using BorderColor property and 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>

View the sample on GitHub.

Output:

CardCustomization.png

Conclusion:

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

You can refer to our .NET MAUI Card’s feature tour page to learn about its other groundbreaking feature representations. You can also 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, you can try our 30-day free trial to check out our .NET MAUI Cards and other .NET MAUI components.

If you have any queries or require clarifications, please let us know in the comments section below. 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