# macaw v0.6.0 - Table of Contents > Macaw's core: composing pages out of independent components that share typed data and interactive state. ## Pages - [README](readme.md) - [Changelog](changelog.md) - Tutorial - [Tutorial](tutorial.md) - [1. Your first surface](01-first-surface.md) - [2. Sources](02-sources.md) - [3. Schemas, tables and deliveries](03-schemas-and-data.md) - [4. Surfaces in depth](04-surfaces.md) - [5. The built-in table](05-the-table.md) - [6. Writing components](06-components.md) - [7. Testing with the conformance kits](07-testing.md) - [8. Surfaces as documents](08-documents.md) - [9. Themes and styles](09-themes.md) - [10. Surfaces in a Phoenix app](10-phoenix.md) - [11. Operations and derived sources](11-operations-and-derived.md) ## Modules - [Macaw](Macaw.md): Macaw's core: composing pages out of independent components that share typed data and interactive state through one source contract (spec/00). - [Macaw.Builtin](Macaw.Builtin.md): The core's built-in components, a package like any other (spec/05 §6): a host enables it by listing it, `Macaw.Registry.new!([Macaw.Builtin, …])`, and it is never enabled implicitly. - [Macaw.Builtin.Accordion](Macaw.Builtin.Accordion.md): The built-in accordion (spec/05 §5.8), `"macaw.accordion"`: a container of one or more panes, one open at a time, of kind `:container`, `:pure`: the WAI-ARIA accordion pattern. - [Macaw.Builtin.AddForm](Macaw.Builtin.AddForm.md): The built-in add form (spec/05 §6.8), `"macaw.add_form"`: a form that adds a row to the visitor's overlay of a source (spec/13 §3), its fields from the source's schema, of kind `:control`, `:pure` (#453). - [Macaw.Builtin.Drawer](Macaw.Builtin.Drawer.md): The built-in drawer (spec/05 §5.7), `"macaw.drawer"`: one pane behind a toggle, of kind `:container`, `:pure`: a disclosure, or a non-modal dialog. - [Macaw.Builtin.Feed](Macaw.Builtin.Feed.md): The built-in feed (spec/05 §6.6), `"macaw.feed"`: time-ordered rows, newest first, of kind `:content`, `:pure`. - [Macaw.Builtin.Filter](Macaw.Builtin.Filter.md): The built-in filter (spec/05 §6.7), `"macaw.filter"`: a choice of one value of one field, of kind `:control`, `:pure` (#452). - [Macaw.Builtin.Meter](Macaw.Builtin.Meter.md): The built-in meter (spec/05 §6.4), `"macaw.meter"`: one number against its range, in a native ``, of kind `:content`, `:pure`. - [Macaw.Builtin.Reading](Macaw.Builtin.Reading.md): One number from a slot's rows, as the built-in stat and meter read it (spec/05 §6.3, §6.4): the statistic a `reduce` setting names, over the field bound to the `value` role, in the delivered rows. - [Macaw.Builtin.Record](Macaw.Builtin.Record.md): The built-in record (spec/05 §6.5), `"macaw.record"`: one row as a definition list, of kind `:content`, `:pure`. - [Macaw.Builtin.Reset](Macaw.Builtin.Reset.md): The built-in reset control (spec/05 §6.9), `"macaw.reset"`: one button that takes the page back to where it started, of kind `:control`, `:pure` (#453, macaw#446 need 5). - [Macaw.Builtin.Sort](Macaw.Builtin.Sort.md): The built-in sort (spec/05 §6.7), `"macaw.sort"`: a choice of the field a table sorts by and its order, of kind `:control`, `:pure` (#452). - [Macaw.Builtin.Split](Macaw.Builtin.Split.md): The built-in split (spec/05 §5.9), `"macaw.split"`: two panes side by side or stacked, with a separator between them and a disclosure collapsing the second, of kind `:container`, `:pure`. - [Macaw.Builtin.Stat](Macaw.Builtin.Stat.md): The built-in stat (spec/05 §6.3), `"macaw.stat"`: one number from a slot's rows, with its label and unit, of kind `:content`, `:pure`. - [Macaw.Builtin.StatusGrid](Macaw.Builtin.StatusGrid.md): The built-in status grid (spec/05 §6.2), `"macaw.status_grid"`: one tile per thing, each showing its state, of kind `:content`, `:pure`. - [Macaw.Builtin.Table](Macaw.Builtin.Table.md): The built-in table (spec/05 §6.1), `"macaw.table"`: an HTML `` of whole rows, of kind `:content`, `:pure`. - [Macaw.Builtin.Table.Rows](Macaw.Builtin.Table.Rows.md): The built-in table's render as keyed parts (spec/05 §6.1, #434): its `head` (a capped or stale notice, the caption, the header and the opening ``), its `rows` in the order drawn, each `{key, version, markup}`, its `tail`, and its `scope`. - [Macaw.Builtin.Tabs](Macaw.Builtin.Tabs.md): The built-in tabs (spec/05 §5.6), `"macaw.tabs"`: a container of one or more panes, one shown at a time, of kind `:container`, `:pure`: the WAI-ARIA tabs pattern. - [Macaw.Builtin.Text](Macaw.Builtin.Text.md): The words the built-in components head a field's value with (spec/05 §6): its label from the source's schema, and its unit as a reader writes it. - [Macaw.Builtin.ThemeSwitch](Macaw.Builtin.ThemeSwitch.md): The built-in theme switch (spec/05 §6.7), `"macaw.theme_switch"`: a choice of the viewer's theme, of kind `:control`, `:pure` (#452). - [Macaw.Container](Macaw.Container.md): The core's side of a container (spec/05 §5): a component of kind `:container` whose content is surfaces, its panes. - [Macaw.Control](Macaw.Control.md): A component that offers choices (spec/05 §6.7, #452): a behavior of macaw's, as `Macaw.Container` and `Macaw.RequestReads` are. - [Macaw.Definition.Derived](Macaw.Definition.Derived.md): A derived source's map and JSON forms (spec/15 §2): an adapter at the edge, moved from macaw_data (dco-tek/macaw/macaw#478 decision 2, #480). The source is the term, `Macaw.Data.Derived`, judged by its `new/1`. - [Macaw.Definition.Schema](Macaw.Definition.Schema.md): A schema's map and JSON forms (spec/15 §1): an adapter at the edge, moved from macaw_data (dco-tek/macaw/macaw#478 decision 2, #480). The schema is the term, `Macaw.Data.Schema`, and its version never goes through this form; JSON is converted only here, at the edge. - [Macaw.Definition.Static](Macaw.Definition.Static.md): A static source's map and JSON forms (spec/15 §3): an adapter at the edge, moved from macaw_data (dco-tek/macaw/macaw#478 decision 2, #480), so a captured static source travels in a bundle. The source is the term, `Macaw.Data.Source.Static`; what is read is judged by its public parts, `Static.assemble/3` and `Static.judge/2`. - [Macaw.Grid](Macaw.Grid.md): The grid a surface places its cells on (spec/06 §3.3), the built-in layout `:grid` (`Macaw.Layout`): 12 columns, or 6 or 24 by `{:grid, columns: n}`. - [Macaw.Layout](Macaw.Layout.md): How a surface lays out its cells (spec/06 §3.3): a behavior, the way a component is one. A layout checks its options and each cell's place, gives the placement faults, the reading order, each cell's classes and declared size, and its one stylesheet. - [Macaw.Layout.Areas](Macaw.Layout.Areas.md): Named regions from a template (spec/06 §3.3), the built-in layout `:areas`, as CSS's `grid-template-areas` lays them out - [Macaw.Layout.Flow](Macaw.Layout.Flow.md): The flow (spec/06 §3.3), the built-in layout `:flow`: sections for prose, in the order the surface gives, `{:flow, order: ["intro", "chart", "notes"]}`, each as tall as its content. A cell has no place. - [Macaw.Layout.Stack](Macaw.Layout.Stack.md): The stack (spec/06 §3.3), the built-in layout `:stack`: one column, the cells in the order the surface gives, `{:stack, order: ["header", "chart", "table"]}`. It is what the grid collapses to on a narrow screen, chosen on purpose. A cell has no place. - [Macaw.Overlay](Macaw.Overlay.md): One visitor's changes to one source's rows (spec/13 §3, #453): the rows added and the rows removed for this visitor only. It is a pure value, held in the visitor's `%Macaw.State{}` at `:session` scope, and never written to the source: another visitor sees the source's rows as they are, and by default a reload starts from them again. - [Macaw.Overlay.Policy](Macaw.Overlay.Policy.md): The host's say over one source's overlay (spec/13 §3.1, #453): who may change its rows, how a row is judged, where the changes are held and how many. The host knows the viewer and the source, so the policy is the host's, given to `Macaw.State.new/2` as `overlays:` by source name, as it binds the source itself; a document never says it. - [Macaw.Page](Macaw.Page.md): A page: the final browser document at one URL (spec/06 §1). It owns its title and its one `

`, its template stack, the regions it fills with surfaces, and the params it accepts. - [Macaw.Page.Graph](Macaw.Page.Graph.md): A page's DAG (spec/03 §6): every source on the page as a node, every binding as an edge, built by pure functions when the page validates (`Macaw.Page.validate/3`) and held in `%Macaw.Page.Validated{}`'s `graph`. - [Macaw.Page.Pulse](Macaw.Page.Pulse.md): A page's ranked pulses (spec/03 §6.3): its surfaces' states and its derived sources' engine as one value, run over the page's graph (`Macaw.Page.Graph`). It holds no process and reads no clock: `now` is the owner's monotonic milliseconds, as `Macaw.Data.Derived.Engine`'s is. - [Macaw.Page.Validated](Macaw.Page.Validated.md): A page that passed its static pass (spec/06 §1.2): `%Macaw.Page.Validated{page, stack, regions, plan, targets, navigations}`. - [Macaw.Preset](Macaw.Preset.md): A preset: a fragment of one component's settings, kept in the library and referenced by name (spec/07 §1). `%Macaw.Preset{name, component, settings, doc}`. - [Macaw.Region](Macaw.Region.md): A region's declaration (spec/06 §4): `%Macaw.Region{name, persistent}`, the least a persistent region needs before templates. - [Macaw.Registry](Macaw.Registry.md): A host's registry of components and layouts (spec/12 §1.1): built from the packages the host enables and the layouts it adds, and nothing else. - [Macaw.RequestReads](Macaw.RequestReads.md): The parameters a slot's request reads (spec/03 §1.5, #441): a component's optional answer, a behavior of macaw's as `Macaw.Container` is. - [Macaw.State](Macaw.State.md): The state of one validated surface (spec/03 §1.5): the value of each of its state sources, its declared ones and the two standard ones, `selection` and `window`. - [Macaw.State.Persistence](Macaw.State.Persistence.md): Where a surface's state survives a reload, a new page or a later visit (spec/03 §3): a host behavior, chosen by the host, since it is a privacy and deployment decision. - [Macaw.State.Persistence.None](Macaw.State.Persistence.None.md): No persistence, the default (spec/03 §3): nothing is stored and nothing loads, so a reload starts every state source at its initial value and nothing reaches a URL. - [Macaw.State.Persistence.Session](Macaw.State.Persistence.Session.md): State in the session (spec/03 §3): the carrier is a session map, as a host reads it (`get_session/1`, or a LiveView's `mount/3` session), each surface's values under its name, as text. It is for state that must not go in a URL: visitor-specific state stays with the visitor, never in a link someone could share. - [Macaw.State.Persistence.Url](Macaw.State.Persistence.Url.md): State in the URL (spec/03 §3): the carrier is a params map, as Phoenix decodes a query string (`handle_params/3`'s params) and encodes one (a verified route's query, or `Plug.Conn.Query.encode/1`), each surface's values nested under its name - [Macaw.State.Preferences](Macaw.State.Preferences.md): The viewer's preferences, standard state sources every surface holds (spec/03 §1.7.3): `theme`, `zone`, `units` and `shortcuts`. They live at `:viewer` scope when the host knows the viewer (`Macaw.State.new/2`'s `instances:` gives `:viewer`) and at `:session` otherwise, and they reach every component in its context, so one person's unit system follows them across every component on every page they visit. - [Macaw.State.Snapshot](Macaw.State.Snapshot.md): A state snapshot (spec/03 §4): the current value of every state source of a surface that persists and isn't declared `snapshot: false`, in the shape of a record's state events (spec/08), each a state and its value, with no instance, time, initiator or identity. It carries no identity of whoever took it, so it restores for whoever restores it. - [Macaw.State.Source](Macaw.State.Source.md): A state source a surface declares (spec/03 §1.1): `%Macaw.State.Source{type, values, initial, scope, persist, snapshot}`. - [Macaw.Surface](Macaw.Surface.md): A surface: a reusable composed unit of cells, laid out by its layout (spec/06 §3.1, §3.3), the 12-column grid by default. - [Macaw.Surface.Cell](Macaw.Surface.Cell.md): A cell: one component placed in a surface (spec/06 §3.2). - [Macaw.Surface.Reader](Macaw.Surface.Reader.md): A source manager's reader (spec/06 §3.5, spec/07 §2.2, #443): how a host lets the paths outside a live page, `Macaw.Surface.fetch/2` (and so `render/2`, `show/2` and a container's surfaces), `Macaw.Surface.legal/2` and `Macaw.Page.check/3`, read a source's data from the manager that holds it rather than from its adapter. - [Macaw.Surface.Validated](Macaw.Surface.Validated.md): A surface that passed the static pass (spec/06 §3.4), and what rendering needs of it: each cell's component module, validated settings and declarations, and each slot's source, description, resolved binding (`Slot.resolve/3`) and request params; `layout` the layout module and its checked options, from the host's registry; `order` is the cells in reading order. - [Macaw.Template](Macaw.Template.md): A template (spec/06 §2.2): `%Macaw.Template{name, regions, order, layout, params, print}`, a registered, named arrangement of regions. - [Macaw.Template.DSL](Macaw.Template.DSL.md): Templates and layers written in code (spec/06 §2.2, §2.3), imported by `use Macaw.Template`. A module defines one template or one layer - [Macaw.Template.Kit](Macaw.Template.Kit.md): The template kit (spec/12 §2.1): a template and its registered layers checked against the stacked-result rules (spec/06 §2.6), so an author proves in a test that every page that may stack them gets a valid page. - [Macaw.Template.Kit.Set](Macaw.Template.Kit.Set.md): A check set for the template kit (spec/12 §2.1): an adopter's own rule over a stacked template, run by `Macaw.Template.Kit.check/3` on every stack that passes. - [Macaw.Template.Layer](Macaw.Template.Layer.md): A layer on a template (spec/06 §2.3): `%Macaw.Template.Layer{name, on, regions, order, layout, params, disclosures, mask}`, a fragment of a template holding only what it gives. - [Macaw.Template.Stacked](Macaw.Template.Stacked.md): A template stack, stacked and validated whole (spec/06 §2.4): what `Macaw.Template.stack/2` answers.