PHPackages                             soysudhanshu/katana - 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. [Templating &amp; Views](/categories/templating)
4. /
5. soysudhanshu/katana

ActiveLibrary[Templating &amp; Views](/categories/templating)

soysudhanshu/katana
===================

Stadalone version of laravel Blade

0.1.0(1w ago)61221[31 issues](https://github.com/soysudhanshu/katana/issues)[4 PRs](https://github.com/soysudhanshu/katana/pulls)MITPHPCI passing

Since Jul 16Pushed today1 watchersCompare

[ Source](https://github.com/soysudhanshu/katana)[ Packagist](https://packagist.org/packages/soysudhanshu/katana)[ RSS](/packages/soysudhanshu-katana/feed)WikiDiscussions master Synced 2d ago

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

Katana
======

[](#katana)

[![Tests](https://github.com/soysudhanshu/katana/actions/workflows/tests.yml/badge.svg)](https://github.com/soysudhanshu/katana/actions/workflows/tests.yml)[![Coverage Status](https://camo.githubusercontent.com/5d8869bb063dae861fe5ff074d452470f04ac55040c110a2c7109b0eae976c20/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6769746875622f736f7973756468616e7368752f6b6174616e612f62616467652e7376673f6272616e63683d6d6173746572)](https://coveralls.io/github/soysudhanshu/katana?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 soysudhanshu/katana
```

### 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

Maintenance79

Regular maintenance activity

Popularity18

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity38

Early-stage or recently created project

 Bus Factor1

Top contributor holds 99.3% of commits — single point of failure

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

10d ago

### Community

Maintainers

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

---

Top Contributors

[![soysudhanshu](https://avatars.githubusercontent.com/u/69431877?v=4)](https://github.com/soysudhanshu "soysudhanshu (145 commits)")[![alexander-zierhut](https://avatars.githubusercontent.com/u/26348781?v=4)](https://github.com/alexander-zierhut "alexander-zierhut (1 commits)")

---

Tags

bladeblade-componentsblade-templatelaravellaravel-blade

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

![Health badge](/badges/soysudhanshu-katana/health.svg)

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

###  Alternatives

[limenius/react-bundle

Client and Server-side react rendering in a Symfony Bundle

3851.2M](/packages/limenius-react-bundle)[area17/laravel-auto-head-tags

Laravel Auto Head Tags helps you build the list of head elements for your app

4616.1k](/packages/area17-laravel-auto-head-tags)[ktquez/laravel-tinymce

TinyMCE editor for Laravel and Lumen Framework

2525.4k](/packages/ktquez-laravel-tinymce)[jelix/wikirenderer

WikiRenderer is a library to generate HTML or anything else from wiki content.

1712.3k1](/packages/jelix-wikirenderer)[webkinder/sproutset

A Composer package for handling responsive images in Roots Bedrock + Sage + Blade projects.

282.2k](/packages/webkinder-sproutset)

PHPackages © 2026

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