Skip to content

oddevan/capsule-ui

Repository files navigation

Capsule UI

A way to build encapsulated components (colocated HTML, CSS and JS) in PHP. (Every Javascript framework is embracing server-side rendering, so why not just skip straight to PHP?)

Installation

Don't. It's not on Packagist yet. I'm using an in-progress version of the Cavatappi framework to build this. Once I get this and that uploaded to Packagist, it'll be simpler. Until then:

  1. Add this repo to your composer.json:
[
  {
    "type": "vcs",
    "url": "https://github.com/oddevan/capsule-ui"
  }
]
  1. Add this to your composer.json:
"oddevan/capsule-ui": "dev-main"

Usage

More detailed writeup to come, but basically call oddEvan\CapsuleUi\CapsuleUi::createRegistry with the preferred modules, then use the ComponentRegistry to render:

$registry = new oddEvan\CapsuleUi\CapsuleUi::createRegistry(oddEvan\UI\Module::class);
$registry->render(
  'card',
  headline: 'Headline',
  description: 'This is a card.',
  submitButtonText: 'Cool!'
);

License

(Currently AGPL, subject to change as project matures.)

Capsule UI by oddEvan Copyright (C) 2025 Evan Hildreth

This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.

You should have received a copy of the GNU Affero General Public License along with this program. If not, see https://www.gnu.org/licenses/.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages