Icon

Display from a variety of different icons.

Inherits from Xamarin.Forms.Label

We are all accustomed to displaying nice icons on our pages. Your mobile application should be no different. This view allows you to display an icon from the FontAwesome or MaterialDesignIcons library on your page.

Properties

PropertyTypeDescription

IconClass

string

The icon class name to use. This can be found on the FontAwesome website. If it specified fas fa-car then you would use car.

IconFamily

The icon font family to use to display the icon. Default value is FontAwesome.

FontSize

double

The size of the icon.

TextColor

The color of the icon to use by default.

Command

ICommand

The command to be executed when the user taps on the icon.

CommandParameter

object

The object to be passed as the parameter to Command.

Example

<StackLayout Orientation="Horizontal">
    <Rock:Icon IconClass="car"
        IconFamily="FontAwesomeSolid"
        FontSize="32" />
    <Rock:Icon
        IconClass="rockrms"
        IconFamily="FontAwesomeBrands"
        TextColor="#ee7725"
        StyleClass="h5" />
    <Rock:Icon IconClass="user"
        StyleClass="text-primary" />
</StackLayout>

Icon Family

Rock Mobile currently supports the font families listed below.

Font FamilyDescription

FontAwesome

Automatically pick the first FontAwesome family that supports the requested icon in order of Regular, Solid and then Brands.

FontAwesomeSolid

The solid set of icons from the FontAwesome free edition version 5.11. For a listing of icons see: https://fontawesome.com/

FontAwesomeRegular

The regular set of icons from the FontAwesome free edition version 5.11. For a listing of icons see: https://fontawesome.com/

FontAwesomeBrands

The brand set of icons from the FontAwesome free editionversion 5.11. For a listing of icons see: https://fontawesome.com/

MaterialDesignIcons

The Material Design icons documented here: https://materialdesignicons.com/

Last updated

⚙️ Powered by Rock RMS