svenpet90 / typo3-kern-ux-components
Fluid components for TYPO3 based on the KERN-UX 2.9 design system.
Package info
github.com/svenpet90/typo3-kern-ux-components
Language:HTML
Type:typo3-cms-extension
pkg:composer/svenpet90/typo3-kern-ux-components
Requires
- php: ^8.2
- typo3/cms-core: ^13.4 || ^14.0
- typo3fluid/fluid: ^4.3 || ^5.0
Requires (Dev)
- phpunit/phpunit: ^11.5 || ^12.0
- typo3/testing-framework: ^9.7
Suggests
None
Provides
None
Conflicts
None
Replaces
None
This package is auto-updated.
Last update: 2026-12-03 13:54:47 UTC
README
Fluid components based on the KERN-UX 2.9 design system, the accessibility-first design system for German public administration.
This is the TYPO3 counterpart to svenpet90/symfony-ux-toolkit-kern-ux, which provides the same components as Twig components for Symfony.
Requirements
- TYPO3 13.4 or 14.x
- PHP 8.2+
- The KERN-UX stylesheet — see INSTALL.md
Components are built on native Fluid components (f:argument / f:slot), introduced in
Fluid 4.3. No third-party component extension is needed.
Note that TYPO3 13.4.0 itself allows Fluid ^4.0, which predates components, so the extension
requires typo3fluid/fluid: ^4.3 || ^5.0 explicitly. On a v13 project that pulls an older
Fluid, Composer will ask you to update it.
Installation
composer require svenpet90/typo3-kern-ux-components
In classic (non-Composer) mode, download a release and unpack it into
typo3conf/ext/kern_ux_components/.
Usage
The extension registers the kern prefix globally, so components work out of the box:
<kern:button variant="secondary" size="large">Antrag starten</kern:button>
If you prefer an explicit import — or your project disables global namespaces — declare it per template instead:
<html xmlns:kern="http://typo3.org/ns/SvenPet90/KernUx/Components/ComponentCollection" data-namespace-typo3-fluid="true"> <kern:button variant="secondary">Antrag starten</kern:button> </html>
Available components
All components of the Symfony kit are available. Tag names follow the folder structure,
so <kern:table.cell> resolves to Components/Table/Cell/Cell.fluid.html.
Layout — <kern:container> · <kern:row> · <kern:col> · <kern:divider>
Typography — <kern:heading> · <kern:title> · <kern:preline> · <kern:subline> ·
<kern:label> · <kern:body> · <kern:list> · <kern:link> · <kern:hgroup>
Content & feedback — <kern:alert> (alert.header, alert.title, alert.description,
alert.icon) · <kern:badge> · <kern:card> (card.header, card.title, card.preline,
card.subline, card.content, card.text, card.footer, card.image) ·
<kern:accordion> (accordion.group) · <kern:details> (details.group) · <kern:dialog> (dialog.header,
dialog.body, dialog.footer) · <kern:dropdown> · <kern:loader> · <kern:progress> ·
<kern:icon> · <kern:button>
Data — <kern:table> (table.head, table.body, table.footer, table.row,
table.header, table.cell) · <kern:descriptionList> (descriptionList.item) ·
<kern:summary> (summary.group) · <kern:taskList> (taskList.item)
Form controls take an optional width argument (2, 4, 5, 10, 20, 30) that
constrains the control itself via kern-form-input__input--width-*, not the surrounding
field.
Forms — <kern:text> · <kern:email> · <kern:tel> · <kern:url> · <kern:number> ·
<kern:password> · <kern:date> · <kern:file> · <kern:textarea> · <kern:select> ·
<kern:checkbox> · <kern:radio> · <kern:fieldset> · <kern:inputGroup>
(inputGroup.text) · <kern:input>
Government header — <kern:kopfzeile> (rendered via the KERN kern-kopfzeile web
component; include its script once per page)
The named input components are thin wrappers over <kern:input>, which carries the shared
label/hint/error markup and the aria-describedby wiring. Use <kern:input type="…">
directly for an input type that has no named component.
<kern:details title="Details zur Einreichungsfrist"> <p class="kern-body">Anträge müssen bis zum 31. März eingegangen sein.</p> </kern:details>
Accessibility note for
<kern:details>: describe the hidden content intitle. Generic labels such as "Mehr anzeigen" are read by screen readers as "Mehr anzeigen, zugeklappt", which does not convey what is behind the element (WCAG 2.4.6).
Differences to the Symfony kit
The two kits emit the same markup — 65 rendering cases across all components were compared and match — but the component API differs where Twig and Fluid do:
- No arbitrary attribute passthrough. Twig components forward any extra attribute via
{{ attributes }}; Fluid components only accept declared arguments. Every component therefore takes aclassargument, and components that need them declareid,href,targetand similar explicitly. - Unknown modifier values are not filtered. The Twig kit uses
html_cva, which silently drops a value that is not in its variant map. Here the value is interpolated, sosize="smal"produceskern-btn--smal. The allowed values are listed in each argument's description and surface in IDE autocompletion. - No copy-in step. Components ship with the extension and are overridden through template paths rather than by editing copied files.
Overriding a component
Add your own template path under a higher key in your extension's
Configuration/Fluid/ComponentCollections.php; paths are processed in reverse key order,
so a higher key wins:
return [ 'SvenPet90\\KernUx\\Components\\ComponentCollection' => [ 'templatePaths' => [ 20 => 'EXT:my_sitepackage/Resources/Private/KernOverrides', ], ], ];
How registration works
TYPO3 v13 and v14 register Fluid namespaces and component collections differently, so the extension ships every variant, deliberately under the same namespace:
| File | Purpose | Used by |
|---|---|---|
Configuration/Fluid/ComponentCollections.php |
declares the collection | TYPO3 14.1+ |
Classes/Components/ComponentCollection.php |
declares the collection | TYPO3 13.4 |
Configuration/Fluid/Namespaces.php |
global kern prefix |
TYPO3 14 |
ext_localconf.php |
global kern prefix via TYPO3_CONF_VARS |
TYPO3 13 only |
When a collection is defined both by class and by configuration, v13 uses the class and v14 uses the configuration. Because the config key is the class's fully qualified name, the XML namespace is identical on both versions and templates do not need to care.
The kern prefix needs the same split treatment: Configuration/Fluid/Namespaces.php is a
v14 mechanism that does not exist in v13, where global namespaces come from
TYPO3_CONF_VARS. v14 still merges TYPO3_CONF_VARS but has deprecated doing so, so
ext_localconf.php registers the prefix only on v13.
The two Fluid generations also disagree on how component template files are found. Fluid 5
probes <Name>.fluid.html before <Name>.html, while Fluid 4.x only appends the configured
format — so ComponentCollection sets the format to fluid.html explicitly. That is what
makes one set of .fluid.html templates work on both TYPO3 versions.
Development
composer install
composer test
Two suites, run separately as composer test:unit and composer test:functional:
Unit — renders every component through standalone Fluid, without booting TYPO3.
Components are plain Fluid templates, so a full instance would add runtime but no coverage.
ComponentSmokeTest discovers components from the file system, so a new component is
covered as soon as its template exists.
Functional — boots a real TYPO3 instance via typo3/testing-framework and covers what
standalone Fluid cannot: that a third-party extension's Configuration/Fluid/*.php is read
at all, that the EXT: path resolves, that the global kern prefix works without an xmlns,
and that fluid:schema:generate emits a schema listing every component. The suite needs no
database ($initializeDatabase = false), so SQLite without a schema is enough:
typo3DatabaseDriver=pdo_sqlite vendor/bin/phpunit -c Build/FunctionalTests.xml
To check the TYPO3 v13 code path locally:
composer require --no-update typo3/cms-core:"^13.4" composer update composer test
CI runs both suites against both TYPO3 versions, because v13 and v14 differ in registration, namespace handling and template resolution.
composer install prints a failing asset:publish step. That is the TYPO3 installer plugin
looking for an application it cannot find in a standalone extension repository; the command
still exits 0 and nothing depends on it.
Not (yet) available
These KERN-UX components are marked "in Bearbeitung" upstream or are not published as open source, so they are intentionally not part of this extension — same as in the Symfony kit:
- Tabs, Header, Notification Banner, Search — under development in KERN-UX 2.9.
- Bildwortmarke — a sovereign emblem that KERN does not publish under an open-source license or as source code.