epic-64

epic-64 / elem

Public

a functional html api

28
0
100% credibility
Found Feb 18, 2026 at 22 stars -- GitGems finds repos before they trend. Get early access to the next one.
Sign Up Free
AI Analysis
PHP
AI Summary

Elem is a fluent PHP library for building type-safe, XSS-protected HTML documents using native PHP code and functions.

How It Works

1
🔍 Discover Elem

You stumble upon Elem, a simple way to build web pages right inside your regular code, making it feel like writing HTML but safer and smarter.

2
📦 Add to Your Project

You easily bring Elem into your existing project with one quick addition, and it's ready to use without any hassle.

3
Build Your First Page

You stack page pieces like building with blocks—create headings, paragraphs, and links that nest perfectly and look just like you imagined.

4
🛠️ Add Lists, Forms, and More

You effortlessly add lists of items, forms for user input, images, and tables, reusing pieces to make everything organized and dynamic.

5
🛡️ Stay Safe Automatically

Any text you add gets protected from tricks or errors, so your page is secure without extra worry.

6
🌟 Preview Your Creation

You turn your code into a beautiful, formatted web page that prints out perfectly ready to view in a browser.

🎉 Share Your Web Page

Your custom web page is live, safe, and professional—perfect for your site, and your friends are impressed!

Sign up to see the full architecture

5 more

Sign Up Free

Star Growth

See how this repo grew from 22 to 28 stars Sign Up Free
Repurpose This Repo

Repurpose is a Pro feature

Generate ready-to-use prompts for X threads, LinkedIn posts, blog posts, YouTube scripts, and more -- with full repo context baked in.

Unlock Repurpose
AI-Generated Review

What is elem?

Elem turns PHP into a functional HTML builder, letting you craft elements like div(class: 'hero')(h1(text: 'Welcome'), p(text: 'Pure PHP power')) that compile to safe, pretty-printed DOM HTML. It ditches template engines for native PHP fluency, handling full documents or fragments with automatic XSS escaping via the DOM extension. PHP 8.4+ devs get composable functions for everything from elementary structures to complex layouts.

Why is it gaining traction?

Type-safe named params catch typos instantly in IDEs and PHPStan, unlike error-prone templates—think no more "hfer" surprises. Full PHP loops, filters, and maps shine for dynamic lists, while slots enable reusable pages without framework lock-in. XSS safety by default plus HTMX-friendly fragments hook devs tired of boilerplate in functional buttons html or functional navigation bar html.

Who should use this?

Backend PHP devs rendering HTML responses in Slim/Laravel APIs, especially HTMX users swapping fragments without JSON. Perfect for crafting functional contact form html, functional calendar html, or elemental UIs like dashboards with slots. Teams chasing PHPStan level 9 will love the autocomplete for elements and forms.

Verdict

Elem's 12 stars and 1.0% credibility score scream early alpha—docs are README-heavy, no battle-tested scale yet—but tests, coverage badges, and a demo server make it worth a spin for functional PHP github experiments. Skip for production unless you dig prototypes.

(198 words)

Sign up to read the full AI review Sign Up Free

Similar repos coming soon.