Introduction

TAW is a modern WordPress theme framework built around PHP blocks, a config-driven metabox engine, and a Vite/Tailwind asset pipeline — no Gutenberg, no ACF, no bloat.

What is TAW?

TAW (Tailwind + Alpine + WordPress) is a component-based WordPress theme framework. Every section of a page — hero, stats, testimonials — is a self-contained block that owns its data, markup, styles, and scripts.

TAW is built for PHP and WordPress developers who prefer code-first workflows. You work in PHP classes, Composer, and Vite — not theme builders or click-driven admin panels.

The framework ships as two pieces:

  • TAW Theme — the starter theme you install per project. Holds your blocks, templates, and functions.php.
  • taw/core — a versioned Composer package with all the framework internals: block system, metabox engine, CLI, forms, mail, and helpers. Update it across all your projects with a single composer update taw/core.

Why TAW?

No Gutenberg. No ACF. No plugin dependencies.

TAW is its own stack. The metabox engine, form system, image helpers, and SVG support are all built in. Your theme stays lean and dependency-free.

Zero-config blocks

Create a folder, drop in a class and a template — it's live. No registration, no functions.php edits, no build step required for new blocks.

CLI scaffolding

php bin/taw make:block Hero --type=meta --with-style creates the folder, class, template, and stylesheet in one command. Export and import blocks between projects as portable ZIPs.

Scoped asset loading

Each block ships its own CSS and JS. Assets are only enqueued on pages that actually use that block. Your homepage doesn't load your blog's scripts.

Rich metabox engine

text, textarea, wysiwyg, image, url, number, range, select, checkbox, color, group, repeater, post_select — with conditional logic, tabbed layouts, and responsive grid placement. No plugin required.

Built-in form system

Form handles CSRF, honeypot spam protection, field validation, PRG redirect, and email delivery. Drop it into any template with a config array.

Transactional email

Mailer wraps wp_mail() with a fluent API and MJML/HTML template support. Write templates once, compile to HTML, deploy. Includes a MailTester admin page.

Theme-level options

OptionsPage brings the same config-driven field experience to site-wide settings stored in wp_options — tabbed UI, validation, and a clean retrieval API included.

Navigation menus

Menu::get() wraps WordPress nav menus into a typed tree, giving you full control over markup without wp_nav_menu().

Modern frontend

Tailwind v4 for utility CSS, Alpine.js for interactivity, Vite for instant HMR — all wired into WordPress through a lightweight bridge. No React, no REST API overhead.


Two types of blocks

TAW has two block types. Pick the one that fits your use case.

MetaBlockBlock (UI)
PurposePage sections that own their dataReusable UI components
Data sourceMetaboxes → post_metaProps passed at render time
Rendered viaBlockRegistry::render('id')(new Button())->render([...])
ExamplesHero, Stats, Testimonials, CTAButton, Card, Badge

MetaBlocks register their own metabox and pull data from post_meta. Editors fill in content through the WordPress admin UI and the block renders it automatically.

UI Blocks are stateless components — they receive props and render markup. Use them to build design-system primitives that MetaBlocks compose together.


Tech stack

TechnologyRole
Tailwind CSS v4Utility-first CSS via the official Vite plugin
Alpine.js v3Lightweight reactivity for interactive components
Vite v7Build tool with instant HMR in development
SCSSOptional custom styles — global and per-block
PHP 8.1+PSR-4 autoloading via Composer
taw/coreVersioned Composer package with all framework internals

Get started

Install the theme

Scaffold a new TAW Theme project inside your WordPress wp-content/themes directory using Composer, then install PHP and JS dependencies.

cd wp-content/themes

composer create-project taw/theme my-theme \
  --repository='{"type":"vcs","url":"https://github.com/Relmaur/taw-theme"}'

cd my-theme
composer install
npm install

Start the dev server

Start Vite for hot module reloading during development, then activate the theme in WordPress Admin → Appearance → Themes.

npm run dev

Scaffold your first block

Use the TAW CLI to create a MetaBlock with styles in one command.

php bin/taw make:block Hero --type=meta --with-style
composer dump-autoload

Render it in a template

Queue the block's assets and render it from your WordPress template.

<?php
// front-page.php
use TAW\Core\BlockRegistry;

BlockRegistry::queue('hero');
get_header();
?>

<?php BlockRegistry::render('hero'); ?>

<?php get_footer(); ?>

See the Quickstart for the full walkthrough, including how to define metabox fields and wire up a complete block.


Continue through the docs

Was this page helpful?