PHPackages                             katanaphp/blade - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. katanaphp/blade

ActiveLibrary

katanaphp/blade
===============

Standalone version of Laravel Blade

0.1.0(3w ago)71↑2900%MIT

Since Jul 16Compare

[ Source](https://github.com/katanaphp/blade)[ Packagist](https://packagist.org/packages/katanaphp/blade)[ RSS](/packages/katanaphp-blade/feed)WikiDiscussions Synced today

READMEChangelog (1)Dependencies (3)Versions (18)Used By (0)

Katana
======

[](#katana)

[![Tests](https://github.com/katanaphp/blade/actions/workflows/tests.yml/badge.svg)](https://github.com/katanaphp/blade/actions/workflows/tests.yml) [![Coverage Status](https://camo.githubusercontent.com/d9ce0b706ffdefabeaf245cc6ae266c24e8883305a0f44a940b7a5baa15c0bfe/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6769746875622f6b6174616e617068702f626c6164652f62616467652e7376673f6272616e63683d6d6173746572)](https://coveralls.io/github/katanaphp/blade?branch=master)

Katana is a lightweight library that enables you to render Laravel Blade templates in any PHP project, without needing the full Laravel framework. Katana encourages you to use new component syntax, however traditional Blade syntax is also supported for porting from other projects like BladeOne.

Katana uses `.blade.php` extension for templates, traditionally stored in `/views` directory but can be configured.

Comparison
----------

[](#comparison)

FeatureKatanaBladeOneLayouts Components✅🟨Layouts Template Inheritance✅✅Control Structures✅✅Loops✅✅Conditional Class &amp; Styles✅❌Additional Form Attributes✅❌Pipes🟨✅> \[!NOTE\] Pipes are now natively supported in PHP 8.5.

Getting Starting
----------------

[](#getting-starting)

You can install the package via composer:

```
composer require katanaphp/blade
```

### Usage

[](#usage)

```
use Blade\Blade;

$blade = $blade = new Blade(__DIR__, __DIR__ . '/.cache');

echo $blade->render('hello', ['name' => 'Jhon Doe']);
```

Layouts
-------

[](#layouts)

### Template Inheritance - ✅

[](#template-inheritance---)

Template inheritance allows you to create layouts by defining a master template that can be extended by child templates.

```
{{-- layouts/app.blade.php --}}

        App Name - @yield('title')

            @yield('content')

            @yield('sidebar')

```

```
{{-- blog-post.blade.php --}}

@extends('layouts.app')

@section('title', 'Home Page')

@section('content')

        Blog Post
        This is the blog post content.

@endsection

@section('sidebar')
    @parent

    Related Posts

        Post 1
        Post 2
        Post 3

@endsection
```

#### Supported Directives

[](#supported-directives)

DirectiveDescriptionStatus`@extends`Directive to extend layout✅`@yield`Outputs a section content✅`@section`Defines a section content✅`@endsection`Defined a end of section content✅`@show`Outputs a section content immediately✅`@parent`Outputs the content of the parent section✅`@hasSection`Determines if section content has been defined✅`@sectionMissing`Determines if section content is missing✅Feature List
------------

[](#feature-list)

### Blade Directives

[](#blade-directives)

DirectiveDescriptionStatus`{{ $var }}`Display the value of the variable✅`{!! $var !!}`Display the value of the variable without escaping✅`@{{ $var }}`Escaping blade directive✅`@{!! $var !!}`Escaping unsafe output directive✅`@@`Escaping control blade directive✅`@verbatim`Prevents rendering.✅### Control Structures

[](#control-structures)

DirectiveDescriptionStatus`@if`If statement✅`@unless`Convenient if✅`@isset`Checks if variable is set✅`@empty`Check if the variable is empty✅`@switch`Switch statement✅`@case`Case statement✅`@default`Default statement✅`@break`Break statement✅`@continue`Continue statement✅### Loops

[](#loops)

DirectiveDescriptionStatus`@for`For loop✅`@foreach`Foreach loop✅`@while`While loop✅`@forelse`Forelse loop✅`$loop`Loop variable in the for loop (basic)✅### Conditional Class &amp; Styles

[](#conditional-class--styles)

DirectiveDescriptionStatus`@class`Conditional class✅`@style`Conditional style✅### Components

[](#components)

DirectiveDescriptionStatus`@component`✅`@slot`✅`Class components`❌`Anonymous component`✅`Vendor Namespacing`❌`Component Attributes`✅`Short hand attribute syntax`✅`Attribute Render Escaping`✅`Component Methods`❌`{{ $attributes }}`✅`{{ $attributes->merge() }}`✅`{{ $attributes->class() }}`✅`{{ $attributes->class() }} Conditional`✅`{{ $attributes->prepends() }}`✅`{{ $attributes->filter() }}`✅`{{ $attributes->whereStartsWith() }}`✅`{{ $attributes->whereDoesntStartWith() }}`✅`{{ $attributes->whereDoesntStartWith()->first() }}`✅`{{ $attributes->has() }}`✅`{{ $attributes->hasAny() }}`✅`{{ $attributes->get() }}`✅`Default {{ $slot }}`✅`Name slots {{ $customSlot }}`✅`$slot->isEmpty()`✅`$slot->hasActualContent()`✅`Scoped Slots`❌`Slot Attributes`✅`Dynamic Components`❌`Anonymous Index Components`✅### Directives

[](#directives)

DirectiveDescriptionStatus`@auth`✅`@guest`✅`@production`✅`@env`✅`@include`✅`@session`❌`@selected`✅`@checked`✅`@disabled`✅`@readonly`✅`@required`✅`@includeIf`✅`@includeWhen`✅`@includeUnless`✅`@includeFirst`✅`@each`✅`@once`✅`@push`✅`@stack`✅`@pushOnce`❌`@prependOnce`❌`@php`✅`@use`❌

###  Health Score

38

—

LowBetter than 83% of packages

Maintenance94

Actively maintained with recent releases

Popularity7

Limited adoption so far

Community2

Small or concentrated contributor base

Maturity39

Early-stage or recently created project

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

26d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/69431877?v=4)[soysudhanshu](/maintainers/soysudhanshu)[@soysudhanshu](https://github.com/soysudhanshu)

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

![Health badge](/badges/katanaphp-blade/health.svg)

```
[![Health](https://phpackages.com/badges/katanaphp-blade/health.svg)](https://phpackages.com/packages/katanaphp-blade)
```

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
