
Type-safe DSL for building and rendering SVG graphics with composable UI integration, intuitive path DSL, gradients, clipping/masking, and first-class Kobweb web application support.
= Doppelganger - SVG DSL for Kotlin :toc: left :toclevels: 3 :source-highlighter: highlightjs :icons: font
A comprehensive and type-safe DSL for creating and rendering SVG graphics in Compose Multiplatform applications and Kobweb sites.
== Overview
Doppelganger is an SVG wrapper library that provides a Kotlin DSL for creating SVG graphics in Compose Multiplatform applications. Write SVG markup using type-safe Kotlin code and render it seamlessly across all supported platforms.
== Features
== Quick Start
=== Installation
Add Doppelganger to your Compose Multiplatform project:
=== Basic Usage
Create an SVG circle in your Composable:
@Composable fun MyCircle() { SvgImage(modifier = Modifier.size(100.dp)) { width(100) height(100) viewBox(0, 0, 100, 100)
circle {
cx(50)
cy(50)
r(40)
fill("steelblue")
stroke("navy")
strokeWidth(2)
}
}
=== Kobweb Usage
Doppelganger includes special support for https://github.com/varabyte/kobweb[Kobweb] applications. See link:KOBWEB_USAGE.md[Kobweb Usage Guide] for detailed documentation.
=== Supported Elements
== Building from Source
To build the library:
To run tests:
To generate documentation:
== Publishing to Maven Central
This template uses a similar packaging secret method as other Malefic projects, making it easy to set up automated publishing.
For publishing to work, the following GitHub secrets must be configured in your repository:
GPG_KEY_ID: The ID of your GPG keyGPG_PASSPHRASE: The passphrase for your GPG keyGPG_PRIVATE_KEY: Your GPG private keySONATYPE_TOKEN_XML: Your Sonatype Central Portal user token in XML format
======= Setting Up Secrets
==== GPG Key Setup
==== Sonatype Setup
io.github.yourusername)=== Publishing Process
The template includes a GitHub Actions workflow that automatically publishes releases:
To publish manually:
== Project Structure
== Configuration
All project configuration is centralized in gradle.properties:
user=YourGitHubUsername dev=Your Full Name mail=your.email@example.com devURL=https://your-website.com
repo=YourRepositoryName g=your.group.id artifact=your-artifact-name desc=Your library description inception=2025
== Example Usage
The template includes a simple Fibonacci sequence generator as an example. Replace this with your own library code:
// Common code fun generateFibi() = sequence { var a = firstElement yield(a) var b = secondElement yield(b) while (true) { val c = a + b yield(c) a = b b = c } }
expect val firstElement: Int expect val secondElement: Int
== License
This template is licensed under the MIT License. Update the LICENSE file with your chosen license.
== Contributing
== Resources
= Doppelganger - SVG DSL for Kotlin :toc: left :toclevels: 3 :source-highlighter: highlightjs :icons: font
A comprehensive and type-safe DSL for creating and rendering SVG graphics in Compose Multiplatform applications and Kobweb sites.
== Overview
Doppelganger is an SVG wrapper library that provides a Kotlin DSL for creating SVG graphics in Compose Multiplatform applications. Write SVG markup using type-safe Kotlin code and render it seamlessly across all supported platforms.
== Features
== Quick Start
=== Installation
Add Doppelganger to your Compose Multiplatform project:
=== Basic Usage
Create an SVG circle in your Composable:
@Composable fun MyCircle() { SvgImage(modifier = Modifier.size(100.dp)) { width(100) height(100) viewBox(0, 0, 100, 100)
circle {
cx(50)
cy(50)
r(40)
fill("steelblue")
stroke("navy")
strokeWidth(2)
}
}
=== Kobweb Usage
Doppelganger includes special support for https://github.com/varabyte/kobweb[Kobweb] applications. See link:KOBWEB_USAGE.md[Kobweb Usage Guide] for detailed documentation.
=== Supported Elements
== Building from Source
To build the library:
To run tests:
To generate documentation:
== Publishing to Maven Central
This template uses a similar packaging secret method as other Malefic projects, making it easy to set up automated publishing.
For publishing to work, the following GitHub secrets must be configured in your repository:
GPG_KEY_ID: The ID of your GPG keyGPG_PASSPHRASE: The passphrase for your GPG keyGPG_PRIVATE_KEY: Your GPG private keySONATYPE_TOKEN_XML: Your Sonatype Central Portal user token in XML format
======= Setting Up Secrets
==== GPG Key Setup
==== Sonatype Setup
io.github.yourusername)=== Publishing Process
The template includes a GitHub Actions workflow that automatically publishes releases:
To publish manually:
== Project Structure
== Configuration
All project configuration is centralized in gradle.properties:
user=YourGitHubUsername dev=Your Full Name mail=your.email@example.com devURL=https://your-website.com
repo=YourRepositoryName g=your.group.id artifact=your-artifact-name desc=Your library description inception=2025
== Example Usage
The template includes a simple Fibonacci sequence generator as an example. Replace this with your own library code:
// Common code fun generateFibi() = sequence { var a = firstElement yield(a) var b = secondElement yield(b) while (true) { val c = a + b yield(c) a = b b = c } }
expect val firstElement: Int expect val secondElement: Int
== License
This template is licensed under the MIT License. Update the LICENSE file with your chosen license.
== Contributing
== Resources