Package-level declarations

Types

Link copied to clipboard

Represents the <circle> element.

Link copied to clipboard

Builder for SVG circle (<circle>) element. This class provides methods to set attributes specific to the <circle> element, such as its center coordinates and radius.

Link copied to clipboard

Represents the <clipPath> element.

Link copied to clipboard

Builder for SVG <clipPath> element. This class provides methods to set attributes and add child elements specific to the <clipPath> element.

Link copied to clipboard

Represents the <defs> element for definitions.

Link copied to clipboard

Builder for SVG <defs> element. This class provides methods to add child elements such as <linearGradient>, <radialGradient>, <clipPath>, <mask>, and <symbol>.

Link copied to clipboard

Represents the <ellipse> element.

Link copied to clipboard

Builder for SVG ellipse (<ellipse>) element. This class provides methods to set attributes specific to the <ellipse> element, such as its center coordinates and radii.

Link copied to clipboard
class G : SvgElement

Represents the <g> (group) element.

Link copied to clipboard

Builder for SVG group (<g>) element. This class provides methods to add child elements such as <rect>, <circle>, <ellipse>, <line>, <polyline>, <polygon>, <path>, <text>, nested <g>, and <use> elements to the group.

Link copied to clipboard

Enum representing the gradient units for an SVG gradient element.

Link copied to clipboard

Represents the <line> element.

Link copied to clipboard

Represents the <linearGradient> element.

Link copied to clipboard

Builder for SVG <linearGradient> element. This class provides methods to set attributes specific to the <linearGradient> element, such as start and end points, gradient units, transformations, and spread methods.

Link copied to clipboard

Builder for SVG line (<line>) element. This class provides methods to set attributes specific to the <line> element, such as the start and end points.

Link copied to clipboard

Represents the <mask> element.

Link copied to clipboard

Builder for SVG <mask> element. This class provides methods to set attributes and add child elements specific to the <mask> element.

Link copied to clipboard

Represents the <path> element.

Link copied to clipboard

Builder for SVG path (<path>) element with path data DSL. This class provides methods to construct complex path data using a fluent API.

Link copied to clipboard

Represents the <polygon> element.

Link copied to clipboard

Builder for SVG polygon (<polygon>) element. This class provides methods to set the points attribute, which defines the list of points that make up the polygon.

Link copied to clipboard

Represents the <polyline> element.

Link copied to clipboard

Builder for SVG polyline (<polyline>) element. This class provides methods to set the points attribute, which defines the list of points that make up the polyline.

Link copied to clipboard

Represents the <radialGradient> element.

Link copied to clipboard

Builder for SVG <radialGradient> element. This class provides methods to set attributes specific to the <radialGradient> element, such as center coordinates, radii, gradient units, transformations, and spread methods.

Link copied to clipboard

Represents the <rect> (rectangle) element.

Link copied to clipboard

Builder for SVG rectangle (<rect>) element. This class provides methods to set attributes specific to the <rect> element, such as position, size, and corner radii.

Link copied to clipboard

Represents the <stop> element for gradients.

Link copied to clipboard

Builder for SVG <stop> element. This class provides methods to set attributes specific to the <stop> element, such as offset, stop color, and stop opacity.

Link copied to clipboard
class Svg : SvgElement

Represents the root <svg> element.

Link copied to clipboard

Builder for SVG root element. This class provides methods to define attributes and child elements for the root <svg> element in an SVG document.

Link copied to clipboard
sealed interface SvgElement

Base interface for all SVG elements. Represents a generic SVG element with attributes and child elements.

Link copied to clipboard
abstract class SvgElementBuilder<T : SvgElement>(element: T)

Abstract base class for building SVG elements. Provides methods to set attributes and common properties for SVG elements.

Link copied to clipboard

Represents the <symbol> element.

Link copied to clipboard

Builder for SVG <symbol> element. This class provides methods to set attributes specific to the <symbol> element, such as viewBox and preserveAspectRatio, and to add child elements like <rect>, <circle>, <path>, and <g>.

Link copied to clipboard

Represents the <text> element.

Link copied to clipboard

Builder for SVG text (<text>) element. This class provides methods to set attributes specific to the <text> element, such as position, font properties, and content.

Link copied to clipboard

Represents the <tspan> element.

Link copied to clipboard

Builder for SVG <tspan> element. This class provides methods to set attributes specific to the <tspan> element, such as position and content.

Link copied to clipboard
class Use : SvgElement

Represents the <use> element.

Link copied to clipboard

Builder for SVG <use> element. This class provides methods to set attributes specific to the <use> element, such as href, xlink:href, position, and size.

Functions

Link copied to clipboard

Creates a clipped shape

Link copied to clipboard

Creates a path with curves

Link copied to clipboard

Creates a colorful rectangle with gradient

Link copied to clipboard

Creates a grouped composition

Link copied to clipboard

Creates a radial gradient circle

Link copied to clipboard

Creates a simple circle

Link copied to clipboard

Creates a smiley face

Link copied to clipboard

Creates a star shape using path

Link copied to clipboard

Creates text with styling

Link copied to clipboard

Escapes special XML characters in text content.

Link copied to clipboard
fun hsl(h: Int, s: Int, l: Int): String

Creates an hsl color string.

Link copied to clipboard
fun hsla(h: Int, s: Int, l: Int, a: Float): String

Creates an hsla color string.

Link copied to clipboard
fun matrix(a: Number, b: Number, c: Number, d: Number, e: Number, f: Number): String

Creates a matrix transform string.

Link copied to clipboard
fun points(vararg coords: Pair<Number, Number>): String

Creates a points string from coordinate pairs.

Link copied to clipboard
@Composable
actual fun RawSvg(svgString: String, modifier: Modifier, contentDescription: String?)
@Composable
expect fun RawSvg(svgString: String, modifier: Modifier = Modifier, contentDescription: String? = null)

Composable function to render raw SVG string

@Composable
actual fun RawSvg(svgString: String, modifier: Modifier, contentDescription: String?)
@Composable
actual fun RawSvg(svgString: String, modifier: Modifier, contentDescription: String?)
@Composable
actual fun RawSvg(svgString: String, modifier: Modifier, contentDescription: String?)
Link copied to clipboard
@Composable
fun RawSvgTag(svgString: String, modifier: Modifier = Modifier, attrs: AttrsScope<HTMLElement>.() -> Unit = {})

Composable function to render raw SVG string in Kobweb using a wrapper div

Link copied to clipboard
fun rgb(r: Int, g: Int, b: Int): String

Creates an rgb color string.

Link copied to clipboard
fun rgba(r: Int, g: Int, b: Int, a: Float): String

Creates an rgba color string.

Link copied to clipboard
fun rotate(angle: Number, cx: Number? = null, cy: Number? = null): String

Creates a rotate transform string.

Link copied to clipboard
fun scale(x: Number, y: Number? = null): String

Creates a scale transform string.

Link copied to clipboard
fun skewX(angle: Number): String

Creates a skewX transform string.

Link copied to clipboard
fun skewY(angle: Number): String

Creates a skewY transform string.

Link copied to clipboard
fun svg(block: SvgBuilder.() -> Unit): Svg

Creates an SVG element using a DSL-style builder.

Link copied to clipboard
@Composable
fun SvgContent(svgElement: Svg, modifier: Modifier = Modifier, contentDescription: String? = null)

Composable function to render SVG content This is a common interface - platform-specific implementations handle actual rendering

Link copied to clipboard
@Composable
fun SvgImage(modifier: Modifier = Modifier, contentDescription: String? = null, content: SvgBuilder.() -> Unit)

Composable function to create and render SVG using DSL

@Composable
fun SvgImage(modifier: Modifier = Modifier, attrs: AttrsScope<HTMLElement>.() -> Unit = {}, content: SvgBuilder.() -> Unit)

Composable function to create and render SVG using DSL in Kobweb This is the recommended way to use Doppelganger with Kobweb

Link copied to clipboard
@Composable
fun SvgTag(svgElement: Svg, modifier: Modifier = Modifier, attrs: AttrsScope<HTMLElement>.() -> Unit = {})

Composable function to render SVG content in Kobweb applications This provides Kobweb-style API using Modifier

Link copied to clipboard

Converts an SVG element to its string representation.

Link copied to clipboard
fun transforms(vararg transforms: String): String

Combines multiple transform strings into a single transform string.

Link copied to clipboard

Creates a translate transform string.

Link copied to clipboard
fun viewBox(minX: Number, minY: Number, width: Number, height: Number): String

Creates a viewBox string from coordinates.