View Source Heroicons.Icon (ex_heroicons v2.0.0)

This module defines the data structure and functions for working with icons stored as SVG files.

Link to this section Summary

Functions

Defines the Heroicons.Icon struct.

Inserts HTML attributes into an SVG icon

Converts opts to HTML attributes

Parses a SVG file and returns structured data

Link to this section Types

@type t() :: %Heroicons.Icon{file: binary(), name: String.t(), type: String.t()}

Link to this section Functions

Link to this function

%Heroicons.Icon{}

View Source (struct)

Defines the Heroicons.Icon struct.

Its fields are:

  • :type - the type of the icon

  • :name - the name of the icon

  • :file - the binary of the icon

Link to this function

insert_attrs(arg, attrs)

View Source
@spec insert_attrs(
  binary(),
  keyword()
) :: Phoenix.HTML.safe()

Inserts HTML attributes into an SVG icon

@spec opts_to_attrs(keyword()) :: list()

Converts opts to HTML attributes

@spec parse!(String.t()) :: t()

Parses a SVG file and returns structured data