PHPackages                             jmf/twig-tabs - 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. jmf/twig-tabs

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

jmf/twig-tabs
=============

Tabs extension for Twig

1.0.0(2w ago)0151mitPHPPHP ^8.3CI passing

Since May 21Pushed 1w agoCompare

[ Source](https://github.com/jmfeurprier/twig-tabs)[ Packagist](https://packagist.org/packages/jmf/twig-tabs)[ RSS](/packages/jmf-twig-tabs/feed)WikiDiscussions 1.0 Synced 1w ago

READMEChangelogDependencies (8)Versions (2)Used By (1)

Twig extension : tabs
=====================

[](#twig-extension--tabs)

Renders tabbed content from Twig templates.

Installation
------------

[](#installation)

```
composer require jmf/twig-tabs
```

Setup
-----

[](#setup)

Pass the Twig `FilesystemLoader` when registering the extension. The `@JmfTwigTabs` namespace is registered automatically:

```
$twig->addExtension(new TabsExtension($templateRenderer, $loader));
```

Usage in Twig templates
-----------------------

[](#usage-in-twig-templates)

### tabs() and tab()

[](#tabs-and-tab)

```
{{ tabs(
    tab('articles').label('First tab').content('Content 1'),
    tab('authors').label('Second tab').include('path/to/template.html.twig', {foo: bar}),
    tab('comments').label('With badge').content('Content 3').badge('5'),
) }}
```

Or passing an array:

```
{{ tabs(myTabBuilders) }}
```

### tab() builder methods

[](#tab-builder-methods)

MethodDescription`.label(string $label)`Tab header label`.content(string $html)`Raw HTML content for the tab pane`.include(string $path, array $parameters)`Render a template as the tab pane content`.badge(?string $badge)`Optional badge displayed next to the labelCustomising templates
---------------------

[](#customising-templates)

Override individual templates by pointing `$templatePath` to your own entry point, or replace the `@JmfTwigTabs` namespace with your own templates directory. The five templates are:

- `bootstrap/tabs.html.twig` — entry point, includes nav and content
- `bootstrap/nav-tabs.html.twig` — `` tab navigation
- `bootstrap/nav-item.html.twig` — individual tab `` + ``
- `bootstrap/tab-content.html.twig` — `` wrapper
- `bootstrap/tab-pane.html.twig` — individual tab pane ``

###  Health Score

42

—

FairBetter than 88% of packages

Maintenance97

Actively maintained with recent releases

Popularity8

Limited adoption so far

Community5

Small or concentrated contributor base

Maturity48

Maturing project, gaining track record

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

Every ~9 days

Total

2

Last Release

10d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/6b08b8105ec8bc88d1c911e10dbf156814769650a67960e2f3d71ed6d2417f0d?d=identicon)[jmfeurprier](/maintainers/jmfeurprier)

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan, Rector

Code StylePHP\_CodeSniffer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/jmf-twig-tabs/health.svg)

```
[![Health](https://phpackages.com/badges/jmf-twig-tabs/health.svg)](https://phpackages.com/packages/jmf-twig-tabs)
```

###  Alternatives

[craftcms/cms

Craft CMS

3.6k3.6M2.9k](/packages/craftcms-cms)

PHPackages © 2026

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