Skip to content

GemIcon

Displays an icon on a webpage.

Usage Example

/* (c) https://github.com/MontiCore/monticore */
package example_basic;

import mc.fenix.basic.GemIcon;
import mc.fenix.basic.GemButton;
import mc.fenix.arrange.GemRow;
import common.ExamplePage;
import mc.fenix.arrange.GemColumn;

page GemIconExample() {
  @ExamplePage(
    component = @GemColumn(components = [
      @GemRow(
        colGap = "15px",
        components = [
          @GemIcon(
            name = "add",
            color = "blue",
            size = "1rem"
          ),
          @GemIcon(
            name = "edit",
            color = "rgb(95,99,104)",
            size = "24px"
          ),
          @GemIcon(
            name = "delete",
            color = "#ff0000",
            size = "2cm"
          )
        ]
      ),
      @GemButton(
        width = "fit-content",
        content = [
          @GemIcon(
            name = "home",
            color = "white",
            size = "30px"
          )
        ]
      )
    ]),
    basePath = "example_basic",
    componentName = "GemIconExample"
  );
}
GemIconExample

GUI Model

component GemIcon(
  String name,
  String color,
  String size
)
Name Type Description Default value
name String Name of the icon to display, corresponding to the icon name from https://fonts.google.com/icons.
color String Color of the icon in hex, rgb, color names, etc. (e.g. #000000, red)
size String Size of the icon in px, %, em, etc.