Reusable UI Components for PHP

Components

Component Library

InstanceIO is a UI component framework for PHP. Build reusable interface components from a PHP class, an HTML template, and CSS, then compose them into server-rendered pages.

Truly extensible

InstanceIO components are open building blocks. Extend the PHP class, replace the HTML template, add defaults and handlers, compose child components, connect providers, or change the CSS without changing the rendering contract. The architecture is expandable as your application grows.

Framework-neutral HTML output

InstanceIO resolves components on the server and emits ordinary flat HTML. Use that output beside React, Vue, Svelte, Alpine, Tailwind, Bootstrap, or a custom design system. InstanceIO does not inject a client-side component runtime, so it does not add a second JavaScript component layer or its bundle overhead.

Core Components

SiteHeader Responsive navigation with mobile menu
Hero Animated hero with grid background and CTAs
Features Feature grid with asymmetric layout
CodeExample Tabbed code editor for PHP/HTML/CSS
CTASection Call-to-action with primary and secondary buttons
SiteFooter Footer with copyright and links

Documentation Components

DocsHero Page hero for docs/components/about pages
DocsContainer Sidebar + content layout for documentation

Creating Components

Scaffold a new component with the CLI:

php console/cmd.php Make component ComponentName

This creates three files in resources/components/ComponentName/:

ComponentName.php    # Class with logic and defaults
ComponentName.html   # HTML template with {%variables%}
ComponentName.css    # Scoped styles

Component Structure

class ComponentName extends Component
{
    public array $defaults = [
        'title' => 'Default Title',
        'content' => 'Default content'
    ];

    public function __construct(
        public array $params,
        public string $component = __DIR__ . '/ComponentName'
    ) {
        parent::__construct($this->params, $this->component);
    }
}

Using Components

Reference components in .iio templates with snake_case:

<component_name title="Hello" content="World" />

PascalCase class names become snake_case in templates. ComponentName → <component_name />

Start building

Scaffold a component in seconds with the CLI.