https://github.com/deanalvero/jsx-parser
A Kotlin Multiplatform library for parsing JSX syntax into a type-safe Abstract Syntax Tree (AST). It is available for iOS, Android, Desktop, and Web.
https://github.com/deanalvero/jsx-parser
jsx jsx-parser kmp kmp-library kotlin kotlin-library kotlin-multiplatform kotlin-native
Last synced: 30 days ago
JSON representation
A Kotlin Multiplatform library for parsing JSX syntax into a type-safe Abstract Syntax Tree (AST). It is available for iOS, Android, Desktop, and Web.
- Host: GitHub
- URL: https://github.com/deanalvero/jsx-parser
- Owner: deanalvero
- License: apache-2.0
- Created: 2025-10-18T02:15:10.000Z (8 months ago)
- Default Branch: main
- Last Pushed: 2026-03-21T18:36:35.000Z (3 months ago)
- Last Synced: 2026-03-22T07:44:26.612Z (3 months ago)
- Topics: jsx, jsx-parser, kmp, kmp-library, kotlin, kotlin-library, kotlin-multiplatform, kotlin-native
- Language: Kotlin
- Homepage: https://deanalvero.github.io/jsx-parser/
- Size: 212 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# JSX Parser for Kotlin
A lightweight, zero-dependency, pure Kotlin Multiplatform library for parsing JSX syntax into a type-safe Abstract Syntax Tree (AST).
This parser is written 100% in `commonMain` and works on all Kotlin targets (JVM, JS, Native, Wasm).
Try out the WASM build of the sample app at https://deanalvero.github.io/jsx-parser/.
## Dependency
Add the dependency to your build.gradle. Replace version with what is available [here](https://central.sonatype.com/artifact/io.github.deanalvero/jsx-parser/versions).
```
implementation("io.github.deanalvero:jsx-parser:")
```
## Usage
```
import io.github.deanalvero.parser.jsx.JsxParser
fun main() {
val source = """
Hello, World!
{message}
""".trimIndent()
val result = JsxParser.parse(source)
result.onSuccess { nodes ->
println("Parsed AST: $nodes")
}.onFailure { error ->
println("Parse error: ${error.message}")
}
}
```
## Notes
Enjoy!