Class Icon

java.lang.Object
io.mindspice.simplypages.core.HtmlTag
io.mindspice.simplypages.components.Icon
All Implemented Interfaces:
Component

public class Icon extends HtmlTag
Icon wrapper for multiple icon-library class conventions.

Mutable and not thread-safe. Library/name/size settings rewrite class attributes in place. Mutate within a request-scoped flow. For reuse, stop mutating and render as a stable structure with per-request slot/context values.

  • Method Details

    • fontAwesome

      public static Icon fontAwesome(String iconName)
      Creates a Font Awesome solid icon.
      Parameters:
      iconName - the icon name (without "fa-" prefix)
    • fontAwesomeRegular

      public static Icon fontAwesomeRegular(String iconName)
      Creates a Font Awesome regular icon.
      Parameters:
      iconName - the icon name (without "fa-" prefix)
    • fontAwesomeBrand

      public static Icon fontAwesomeBrand(String iconName)
      Creates a Font Awesome brand icon.
      Parameters:
      iconName - the icon name (without "fa-" prefix)
    • material

      public static Icon material(String iconName)
      Creates a Material Icon.
      Parameters:
      iconName - the material icon name
    • bootstrap

      public static Icon bootstrap(String iconName)
      Creates a Bootstrap Icon.
      Parameters:
      iconName - the icon name (without "bi-" prefix)
    • custom

      public static Icon custom(String className)
      Creates a custom icon with custom CSS class.
      Parameters:
      className - the complete icon class name
    • small

      public Icon small()
      Sets small size.
    • large

      public Icon large()
      Sets large size.
    • extraLarge

      public Icon extraLarge()
      Sets extra large size.
    • withAriaLabel

      public Icon withAriaLabel(String label)
      Adds an aria-label for accessibility.
      Parameters:
      label - the accessible label