ui-awesome / html-svg
UI Awesome HTML SVG library for PHP.
Fund package maintenance!
terabytesoftw
Installs: 8 633
Dependents: 7
Suggesters: 0
Security: 0
Stars: 1
Watchers: 1
Forks: 0
Open Issues: 0
pkg:composer/ui-awesome/html-svg
Requires
- php: ^8.1
- ext-dom: *
- ext-libxml: *
- enshrined/svg-sanitize: ^0.18
- php-forge/awesome-widget: ^0.1
- ui-awesome/html-attribute: ^0.2
- ui-awesome/html-concern: ^0.2
- ui-awesome/html-core: ^0.1
- ui-awesome/html-interop: ^0.1
Requires (Dev)
- maglnet/composer-require-checker: ^4.7
- php-forge/support: ^0.1
- phpunit/phpunit: ^10.5
- roave/infection-static-analysis-plugin: ^1.34
- symplify/easy-coding-standard: ^12.1
- vimeo/psalm: ^5.20
This package is auto-updated.
Last update: 2025-12-28 19:51:03 UTC
README
Html SVG
A robust, fluent, and immutable PHP library for generating and manipulating SVG elements.
Secure file loading, accessibility-first design, and standards-compliant rendering.
Features
Installation
composer require ui-awesome/html-svg:^0.3
Quick start
The SVG element is a container that defines a new coordinate system and viewport.
It is used as the outermost element of SVG documents, but it can also be used to embed an SVG fragment inside an SVG or HTML document.
Basic usage
use UIAwesome\Html\Svg\Svg; // create a simple SVG with path echo Svg::tag() ->content('<path d="..." />') ->viewBox('0 0 100 100') ->render();
Loading from file (Secure)
use UIAwesome\Html\Svg\Svg; // load, sanitize, and inject an external SVG file echo Svg::tag() ->class('icon-lg') ->filePath('/path/to/icon.svg') ->fill('currentColor') ->render();
Accessibility handling
use UIAwesome\Html\Svg\Svg; // automatically injects <title> tag for screen readers echo Svg::tag() ->content('<path d="..." />') // Becomes <title>User Profile</title> ->title('User Profile') ->render();
Documentation
For detailed configuration options and advanced usage.