Documentation
¶
Overview ¶
Package svg provides shared SVG rendering primitives and path constants used across multiple component packages (display, feedback, icons).
Index ¶
Examples ¶
Constants ¶
View Source
const ( PathChevronDown = "M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z" PathChevronSmall = "" /* 131-byte string literal not displayed */ PathXMark = "M6 18L18 6M6 6l12 12" PathArrowUp = "" /* 134-byte string literal not displayed */ PathArrowDown = "" /* 135-byte string literal not displayed */ PathArrowLeft = "" /* 131-byte string literal not displayed */ PathArrowRight = "" /* 131-byte string literal not displayed */ PathAvatarFill = "M24 20.993V24H0v-2.996A14.977 14.977 0 0112.004 15c4.904 0 9.26 2.354 11.996 5.993zM16.002 8.999a4 4 0 11-8 0 4 4 0 018 0z" )
Common SVG path data constants — single source of truth for inline paths.
Variables ¶
This section is empty.
Functions ¶
func FillIcon ¶
FillIcon renders a 20×20 filled SVG icon with the given class and path.
Example ¶
package main
import (
"github.com/larsartmann/templ-components/utils/svg"
)
func main() {
_ = svg.FillIcon("w-5 h-5", "M12 2a10 10 0 100 20 10 10 0 000-20z", false)
}
Output:
func SpinnerSVG ¶
SpinnerSVG renders the inner SVG elements for a loading spinner. Wrap in an <svg> tag with animate-spin and desired size.
Example ¶
package main
import (
"github.com/larsartmann/templ-components/utils/svg"
)
func main() {
_ = svg.SpinnerSVG()
}
Output:
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.