menu

MAUI Toolkit

  • User Guide
  • Demos
  • Support
Class SfChip - MAUI-ToolKit API Reference | Syncfusion

    Show / Hide Table of Contents

    Class SfChip

    Represents a Chip control which can be added in a layout and grouped using SfChipGroup. Represents the SfChip class.

    Inheritance
    System.Object
    SfView
    ButtonBase
    SfChip
    Implements
    IDrawableLayout
    Microsoft.Maui.Graphics.IDrawable
    Microsoft.Maui.IAbsoluteLayout
    Microsoft.Maui.ILayout
    Microsoft.Maui.IView
    Microsoft.Maui.IElement
    Microsoft.Maui.ITransform
    Microsoft.Maui.IContainer
    System.Collections.Generic.IList<Microsoft.Maui.IView>
    System.Collections.Generic.ICollection<Microsoft.Maui.IView>
    System.Collections.Generic.IEnumerable<Microsoft.Maui.IView>
    System.Collections.IEnumerable
    Microsoft.Maui.ISafeAreaView
    Microsoft.Maui.IPadding
    Microsoft.Maui.ICrossPlatformLayout
    Microsoft.Maui.IVisualTreeElement
    Inherited Members
    ButtonBase.Background
    ButtonBase.BackgroundImageSource
    ButtonBase.BackgroundImageSourceProperty
    ButtonBase.BackgroundProperty
    ButtonBase.Clicked
    ButtonBase.Command
    ButtonBase.CommandParameter
    ButtonBase.CommandParameterProperty
    ButtonBase.CommandProperty
    ButtonBase.CornerRadius
    ButtonBase.CornerRadiusProperty
    ButtonBase.EnableRippleEffect
    ButtonBase.EnableRippleEffectProperty
    ButtonBase.Finalize()
    ButtonBase.FontAttributes
    ButtonBase.FontAttributesProperty
    ButtonBase.FontAutoScalingEnabled
    ButtonBase.FontAutoScalingEnabledProperty
    ButtonBase.FontFamily
    ButtonBase.FontFamilyProperty
    ButtonBase.FontSize
    ButtonBase.FontSizeProperty
    ButtonBase.HorizontalTextAlignment
    ButtonBase.HorizontalTextAlignmentProperty
    ButtonBase.ImageAlignment
    ButtonBase.ImageAlignmentProperty
    ButtonBase.ImageSize
    ButtonBase.ImageSizeProperty
    ButtonBase.ImageSource
    ButtonBase.ImageSourceProperty
    ButtonBase.OnHandlerChanged()
    ButtonBase.Padding
    ButtonBase.PaddingProperty
    ButtonBase.ShowIcon
    ButtonBase.ShowIconProperty
    ButtonBase.Stroke
    ButtonBase.StrokeProperty
    ButtonBase.StrokeThickness
    ButtonBase.StrokeThicknessProperty
    ButtonBase.Text
    ButtonBase.TextColor
    ButtonBase.TextColorProperty
    ButtonBase.TextProperty
    ButtonBase.VerticalTextAlignment
    ButtonBase.VerticalTextAlignmentProperty
    SfView.Children
    SfView.ClipToBounds
    Namespace: Syncfusion.Maui.Toolkit.Chips
    Assembly: Syncfusion.Maui.Toolkit.dll
    Syntax
    public class SfChip : ButtonBase, IDrawableLayout, IDrawable, IAbsoluteLayout, ILayout, IView, IElement, ITransform, IContainer, IList<IView>, ICollection<IView>, IEnumerable<IView>, IEnumerable, ISafeAreaView, IPadding, ICrossPlatformLayout, IVisualTreeElement, ISemanticsProvider, ITouchListener, ITextElement, ITapGestureListener, IGestureListener, IParentThemeElement, IThemeElement

    Constructors

    SfChip()

    Initializes a new instance of the SfChip class.

    Declaration
    public SfChip()

    Fields

    CloseButtonColorProperty

    Identifies the CloseButtonColor bindable property.

    Declaration
    public static readonly BindableProperty CloseButtonColorProperty
    Field Value
    Type
    Microsoft.Maui.Controls.BindableProperty
    Remarks

    The CloseButtonColor property determines the color of the close button.

    CloseButtonPathProperty

    Identifies the CloseButtonPath bindable property.

    Declaration
    public static readonly BindableProperty CloseButtonPathProperty
    Field Value
    Type
    Microsoft.Maui.Controls.BindableProperty
    Remarks

    The CloseButtonPath property determines the path of the close button.

    SelectionIndicatorColorProperty

    Identifies the SelectionIndicatorColor bindable property.

    Declaration
    public static readonly BindableProperty SelectionIndicatorColorProperty
    Field Value
    Type
    Microsoft.Maui.Controls.BindableProperty
    Remarks

    The SelectionIndicatorColor property determines the color of the selection indicator.

    ShowCloseButtonProperty

    Identifies the ShowCloseButton bindable property.

    Declaration
    public static readonly BindableProperty ShowCloseButtonProperty
    Field Value
    Type
    Microsoft.Maui.Controls.BindableProperty
    Remarks

    The ShowCloseButton property determines whether the close button is visible or not.

    ShowSelectionIndicatorProperty

    Identifies the ShowSelectionIndicator bindable property.

    Declaration
    public static readonly BindableProperty ShowSelectionIndicatorProperty
    Field Value
    Type
    Microsoft.Maui.Controls.BindableProperty
    Remarks

    The ShowSelectionIndicator property determines whether the selection indicator is visible or not.

    Properties

    CloseButtonColor

    Gets or sets the value that can be used to change the color of the close button.

    Declaration
    public Color CloseButtonColor { get; set; }
    Property Value
    Type Description
    Microsoft.Maui.Graphics.Color

    It accepts Microsoft.Maui.Graphics.Color values and the default value is Color.FromArgb("#1C1B1F").

    Remarks

    This property allows you to customize the appearance of the close button by setting its color.

    Examples

    Here is an example of how to set the CloseButtonColor property

    • XAML
    • C#
    <local:SfChip CloseButtonColor="Red" />
    var chip = new SfChip
    {
        CloseButtonColor = Color.FromArgb("#FF0000")
    };

    CloseButtonPath

    Gets or sets the value of CloseButtonPath. This property can be used to customize the close button.

    Declaration
    public string CloseButtonPath { get; set; }
    Property Value
    Type Description
    System.String

    Specifies the close button path. The default value is System.String.Empty.

    Remarks

    This property allows you to set a custom path for the close button icon, enabling you to use a custom SVG or other path data.

    Examples

    Here is an example of how to set the CloseButtonPath property

    • XAML
    • C#
    <local:SfChip CloseButtonPath="M10 10 H 90 V 90 H 10 L 10 10" />
    var chip = new SfChip
    {
        CloseButtonPath = "M10 10 H 90 V 90 H 10 L 10 10"
    };

    IsSelected

    Gets a value indicating whether the SfChip is selected.

    Declaration
    public bool IsSelected { get; }
    Property Value
    Type Description
    System.Boolean

    A boolean value indicating the selection state of the chip. The default value is false.

    Remarks

    This property allows you to determine if the chip is currently selected. It is internally set and cannot be modified directly.

    SelectionIndicatorColor

    Gets or sets the value of SelectionIndicatorColor. This property can be used to change the color of the selection indicator.

    Declaration
    public Color SelectionIndicatorColor { get; set; }
    Property Value
    Type Description
    Microsoft.Maui.Graphics.Color

    Specifies the selection indicator color. The default value is Color.FromArgb("#49454F").

    Remarks

    This property allows you to customize the color of the selection indicator.

    Examples

    Here is an example of how to set the SelectionIndicatorColor property

    • XAML
    • C#
    <local:SfChip SelectionIndicatorColor="Blue" />
    var chip = new SfChip
    {
        SelectionIndicatorColor = Color.FromRgb(0, 0, 255)
    };

    ShowCloseButton

    Gets or sets a value indicating whether the close button is visible or not. The close button is in a visible state when this property is set to true.

    Declaration
    public bool ShowCloseButton { get; set; }
    Property Value
    Type Description
    System.Boolean

    Specifies the show close button property. The default value is false.

    Remarks

    This property allows you to control the visibility of the close button on the chip.

    Examples

    Here is an example of how to set the ShowCloseButton property

    • XAML
    • C#
    <local:SfChip ShowCloseButton="True" />
    var chip = new SfChip
    {
        ShowCloseButton = true
    };

    ShowSelectionIndicator

    Gets or sets a value indicating whether the selection indicator is visible or not. The selection indicator is in a visible state when this property is set to true.

    Declaration
    public bool ShowSelectionIndicator { get; set; }
    Property Value
    Type Description
    System.Boolean

    Specifies the show selection indicator property. The default value is false.

    Remarks

    This property allows you to control the visibility of the selection indicator on the chip.

    Examples

    Here is an example of how to set the ShowSelectionIndicator property

    • XAML
    • C#
    <local:SfChip ShowSelectionIndicator="True" />
    var chip = new SfChip
    {
        ShowSelectionIndicator = true
    };

    Events

    CloseButtonClicked

    Occurs when the close button is clicked/tapped.

    Declaration
    public event EventHandler<EventArgs> CloseButtonClicked
    Event Type
    Type
    System.EventHandler<System.EventArgs>
    Examples

    Here is an example of how to register the CloseButtonClicked event.

    • C#
    SfChip chip = new SfChip();
    chip.CloseButtonClicked += chip_CloseButtonClicked;
    
    private async void chip_CloseButtonClicked(object sender, EventArgs e)
    {
    	await DisplayAlert("Message", "Chip CloseButton Clicked", "close");
    }

    Implements

    IDrawableLayout
    Microsoft.Maui.Graphics.IDrawable
    Microsoft.Maui.IAbsoluteLayout
    Microsoft.Maui.ILayout
    Microsoft.Maui.IView
    Microsoft.Maui.IElement
    Microsoft.Maui.ITransform
    Microsoft.Maui.IContainer
    System.Collections.Generic.IList<>
    System.Collections.Generic.ICollection<>
    System.Collections.Generic.IEnumerable<>
    System.Collections.IEnumerable
    Microsoft.Maui.ISafeAreaView
    Microsoft.Maui.IPadding
    Microsoft.Maui.ICrossPlatformLayout
    Microsoft.Maui.IVisualTreeElement
    Back to top Generated by DocFX
    Copyright © 2001 - 2025 Syncfusion Inc. All Rights Reserved