PHPackages                             ether/atom - 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. ether/atom

ActiveCraft-plugin[Templating &amp; Views](/categories/templating)

ether/atom
==========

Adding enhanced modularity to Craft CMS Twig templating

5.0.0(2y ago)91.3k1[1 issues](https://github.com/ethercreative/atom/issues)MITPHP

Since Feb 12Pushed 2y ago2 watchersCompare

[ Source](https://github.com/ethercreative/atom)[ Packagist](https://packagist.org/packages/ether/atom)[ RSS](/packages/ether-atom/feed)WikiDiscussions v5 Synced 1w ago

READMEChangelog (8)Dependencies (1)Versions (13)Used By (0)

Atom
====

[](#atom)

Adding enhanced modularity to Craft CMS Twig templating

[![Atom](./resources/banner.png)](./resources/banner.png)

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

[](#installation)

```
$ composer require ether/atom
```

Usage
-----

[](#usage)

Create a folder called `_atoms` in your `templates` directory (this can be customised, see [Config](#config)).

### Basic

[](#basic)

In this folder you can create re-usable twig templates, or atoms (a.k.a. modules, components, molecules). You can access the atoms in twig using the following syntax:

```
{% x:my-atom %}
```

The above will include `_atoms/my-atom` in your template. If `my-atom`doesn't exist then nothing will be output.

### Parameters

[](#parameters)

You can pass parameters to your atom which will be exposed within the atom. The current template context is NOT passed to the atom, so any variables defined outside will have to be passed manually.

```
{% x:my-atom { heading: "Hello world!" } %}
```

In the above example, `my-atom` will be given access to the `heading` variable. If `heading` isn't passed then the variable will be undefined. You'll want to check variable availability with `is defined` or `|default`.

### Children

[](#children)

Children can also be passed to atoms:

```
{% x:my-atom { heading: "Hello world!" } %}
    This is my atom
    There are many like it, but this is mine
    {{ myVariable }}
{% endx:my-atom %}
```

Children are rendered in the parent context, not the atoms. This means any variables you pass to the atom will not be available in the children (unless they are also available in the parent context).

Children are rendered within the atom using the `children` variable, which will contain the rendered contents of the children or `null` if no children are defined.

```
{# Contents of `_atoms/my-atom` #}

    {{ heading }}
    {{ children }}

```

### Nested

[](#nested)

Atoms can be nested inside other atoms!

```
{% x:my-atom %}
    {% x:another-atom %}
{% endx:my-atom %}
```

### Sub-folders

[](#sub-folders)

You can store atoms in folders within your `_atoms` directory. For example, if you had an atom at `_atoms/cards/news`, you could access it using the following syntax:

```
{% x:cards/news %}
```

### Dynamic Atoms

[](#dynamic-atoms)

You can render atoms with dynamic names by wrapping the atom name in square brackets:

```
{% set myVar = 'example-atom' %}

{% x:[myVar] %}

{% x:[myVar] %}
    hello world!
{% endx:[myVar] %}
```

Config
------

[](#config)

You can configure Atom by creating a `atom.php` file in your `config` folder. See [config.php](./src/config.php) for the available settings.

###  Health Score

30

—

LowBetter than 64% of packages

Maintenance18

Infrequent updates — may be unmaintained

Popularity21

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity60

Established project with proven stability

 Bus Factor1

Top contributor holds 100% 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

Every ~114 days

Recently: every ~73 days

Total

11

Last Release

782d ago

Major Versions

1.0.5 → v3.x-dev2023-06-08

v3.x-dev → 4.0.02024-03-27

4.0.0 → 5.0.02024-03-27

### Community

Maintainers

![](https://www.gravatar.com/avatar/30c8191e4ff2ab8c26533caccdb3d82972acfb51bc5dc9650cb1d63b6ec48e82?d=identicon)[ether](/maintainers/ether)

---

Top Contributors

[![Tam](https://avatars.githubusercontent.com/u/977594?v=4)](https://github.com/Tam "Tam (17 commits)")

### Embed Badge

![Health badge](/badges/ether-atom/health.svg)

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

###  Alternatives

[nystudio107/craft-templatecomments

Adds a HTML comment with performance timings to demarcate `{% block %}`s and each Twig template that is included or extended.

20108.4k3](/packages/nystudio107-craft-templatecomments)[superbig/craft-mjml

Render Twig emails with MJML, the only framework that makes responsive email easy.

2627.3k1](/packages/superbig-craft-mjml)[verbb/footnotes

Adds a footnotes feature to CKEditor fields and Twig templates.

213.3k](/packages/verbb-footnotes)

PHPackages © 2026

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