Vitor Py
Date: 2025-10-12
solhtmx is a Solana-native extension to htmx that simplifies blockchain interactions using HTML attributes. It lets you:
All using declarative HTML, without complex JavaScript.
Building blockchain apps typically involves:
This means lots of JavaScript and careful orchestration of async operations.
solhtmx extends htmx with Solana-specific attributes:
<button sol-connect="true"
hx-get="/api/wallet-status"
hx-target="#wallet-info">
Connect Wallet
</button>
Clicking the button:
<button sol-sign="true"
hx-post="/api/prepare-transfer"
hx-vals='{"amount": "0.1"}'
hx-target="#result">
Send 0.1 SOL
</button>
The server just builds transactions and returns HTML. solhtmx does the rest.
<script src="https://unpkg.com/htmx.org@2.0.0"></script> <script src="https://unpkg.com/@solana/web3.js@latest"></script> <script src="path/to/solhtmx.js"></script>
Configure network via meta tags:
<meta name="sol-network" content="devnet"> <meta name="sol-commitment" content="confirmed">
Code, examples, docs: github.com/vitorpy/solhtmx
Open source (WTFPL). Contributions welcome.
solhtmx simplifies Solana app development using declarative HTML attributes. Give it a try and share your feedback.