svg

package
v0.3.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 5, 2026 License: MIT Imports: 21 Imported by: 0

Documentation

Overview

Package svg provides constructors and methods for the HTML <svg> element.

The <svg> HTML element is a container that defines a new coordinate system and viewport. It is used as the outermost element of SVG documents, but it can also be used to embed an SVG fragment inside an SVG or HTML document.

Index

Constants

This section is empty.

Variables

View Source
var (
	TagOpen  = []byte("<svg")
	TagClose = []byte("</svg>")

	AttrWidth               = []byte(" width=\"")
	AttrHeight              = []byte(" height=\"")
	AttrViewBox             = []byte(" viewBox=\"")
	AttrPreserveAspectRatio = []byte(" preserveAspectRatio=\"")
	AttrXmlns               = []byte(" xmlns=\"")
)

Byte constants for HTML rendering.

Functions

func New

func New(nodes ...node.Node) *element

New creates a new svg element with child SVG elements. Example: svg.New().Width("100").Height("100").ViewBox("0 0 100 100") Renders: <svg width="100" height="100" viewBox="0 0 100 100"></svg>

Types

type Element

type Element = element

Element is an exported alias for the private element type

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL