Anarchitecture Bricks Docs

Repository documentation hub for packages, guides, and generated references.

@anarchitects/common-angular-ui-layouts

Pluggable layout runtime infrastructure for Angular bricks.

This package provides layout contracts, registry, runtime host, and built-in default layouts. It is shared infrastructure only and does not embed domain-specific behavior.

Features

Installation

npm install @anarchitects/common-angular-ui-layouts
# or
yarn add @anarchitects/common-angular-ui-layouts

Entry points

Layout kinds and defaults

Resolution precedence

  1. explicit host input [layout]
  2. provider default from ANX_LAYOUT_DEFAULTS[kind]
  3. built-in fallback for the kind

Shell Utility Boundary

Shell utility classes (anx-region, anx-stack, anx-inline, anx-grid) are consumer shell layout classes and must not be used by package host bindings or internal templates.

Use explicit component CSS for spacing and flow in layout renderers.

Incorrect:

host: { class: 'anx-default-layout anx-stack' }

Correct:

host: { class: 'anx-default-layout' }
:host {
  display: grid;
  gap: var(--anx-layout-gap-stack);
  padding: var(--anx-layout-block-padding-current);
}

Consumer extension

Consumer apps can add layouts without modifying core by:

  1. Creating a renderer component that accepts context: AnxResolvedLayoutContext
  2. Registering it with provideAnxLayouts([...])
  3. Overriding defaults with provideAnxLayoutDefaults({...})

Usage

Use this package when runtime-selectable layout behavior is required. Keep layout resolution in shared infrastructure and keep shell utility class usage in consumer route/page wrappers.

Validation workflow

Contract and downstream validation references:

  1. yarn nx run guardrails:test
  2. yarn nx run forms-angular-ui:test --testFile=libs/forms/angular/ui/src/form.spec.ts

Documentation

Development notes

Source Links