https://github.com/cosminstaicu/antheia
PHP frontend library for web-based apps.
https://github.com/cosminstaicu/antheia
dark-theme frontend interface php responsive webapp
Last synced: 5 months ago
JSON representation
PHP frontend library for web-based apps.
- Host: GitHub
- URL: https://github.com/cosminstaicu/antheia
- Owner: cosminstaicu
- License: apache-2.0
- Created: 2022-10-02T19:37:35.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2025-12-31T10:14:35.000Z (6 months ago)
- Last Synced: 2026-01-01T08:32:04.643Z (6 months ago)
- Topics: dark-theme, frontend, interface, php, responsive, webapp
- Language: PHP
- Homepage: https://antheia.voipit.ro
- Size: 13 MB
- Stars: 4
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
- Security: SECURITY.md
Awesome Lists containing this project
README
# Antheia
A PHP library for building responsive, component-based web interfaces, designed for server-rendered web applications.
> ⚠️ Antheia 2.x is a major release with breaking changes. Versions 1.x.x are
no longer supported. Please review the [changelog](CHANGELOG.md) before upgrading.





A live example of the interface (based on the current major version) is available at [antheia.voipit.ro](https://antheia.voipit.ro).
The demo uses the content from the `examples` folder.
Please check the [project wiki](https://github.com/cosminstaicu/antheia/wiki) for more details about the library.
Antheia is used in production by the Cloud PBX service **Accolades**, provided by [VoIPIT Romania](https://www.voipit.ro).
## Installation
Use [composer](https://getcomposer.org) to install Antheia into your project:
```sh
composer require antheia/antheia
```
After installation, you must configure a cache folder for Antheia before rendering any pages.
The cache folder:
- must be writable by the application
- must have a corresponding public URL
- should not be publicly writable beyond what Antheia requires
You can configure it at runtime using:
```php
Globals::setCache(string $url, string $path);
```
The `$url` must point to the public URL of the cache directory,
while `$path` must be the absolute filesystem path.
Failing to configure the cache correctly will result in runtime errors.
## Quick Start
```php
require __DIR__ . '/vendor/autoload.php';
use Antheia\Antheia\Globals;
use Antheia\Antheia\Page\PageEmpty;
// set up the cache folder
Globals::setCache('/cache', __DIR__ . '/public/cache');
// create a new empty page
$page = new PageEmpty();
// output the page content
echo $page->getHtml();
```
`PageEmpty` represents the minimal Antheia page layout without predefined components.
This will render a minimal, empty Antheia page and output the generated HTML.
## End to end testing
Most HTML items can have a test attribute (with the default name `data-testid`)
that will be output only when test mode is enabled. This is useful when the final
product needs e2e testing (for example, with
[Playwright](https://github.com/microsoft/playwright))
This allows stable selectors for automated end-to-end tests without affecting production HTML output.
```php
require __DIR__ . '/vendor/autoload.php';
use Antheia\Antheia\Globals;
use Antheia\Antheia\Page\PageEmpty;
use Antheia\Antheia\Classes\Header\TopRightMenu\TopRightMenuUser;
// set up the cache folder
Globals::setCache('/cache', __DIR__ . '/public/cache');
// create a new empty page
$page = new PageEmpty();
// creates a menu on the top right side
$option = new TopRightMenuUser();
// defines the testid value
$option->setTestId('topMenuUser');
$option->setName('User name here');
$option->setHref('#');
$page->addTopRightMenu($option);
// If Globals::setTestMode() is called then the HTML tag for
// the menu will contain data-testid = "topMenuUser"
// If the method is not called then the HTML tag will not
// have the attribute
Globals::setTestMode();
// output the page content
echo $page->getHtml();
```
## Supported Versions
- **2.x.x** — actively maintained
- **1.x.x** — end of life, no longer supported
## Documentation
All PHP code is documented using the PHPDoc standard. Most IDEs can provide code
completion and inline documentation (the library is primarily developed using
[Eclipse PDT](https://www.eclipse.org/pdt/)).
JavaScript files are documented using the JSDoc standard.
Examples located in the `examples` folder are explained in detail in the
[project wiki](https://github.com/cosminstaicu/antheia/wiki).
For upgrade notes and breaking changes introduced in 2.0.0, refer to the changelog.
## Security
Please review our [Security Policy](SECURITY.md) for reporting vulnerabilities.
## Credits
Icons used by the framework are provided by:
- [IO Broker icons](https://github.com/ioBroker/ioBroker.icons-fatcow-hosting)
- [Lucide Icons](https://github.com/lucide-icons/lucide)
Color schemes for the predefined themes are provided freely by [Scheme Color](https://www.schemecolor.com).
Images used by the framework are provided freely by [Unsplash](https://unsplash.com).
# License
Antheia is licensed under [Apache-2.0](https://github.com/cosminstaicu/antheia/blob/main/LICENSE).