---
title: Fluid View
category: Infusion
type: infusion-docs
---
This page documents how Fluid Infusion 6 components render markup: the template binding syntax, the
Single File Component (SFC) format, and the machinery of views. It builds on the
[Fluid Integration Language](/docs/fluid-integration-language) (layers, references, `$compute`, `$method`, `$effect`,
`$component`) and on [`fluid.cell`](/docs/fluid-signals) (signals, effects, source tracking).
The raw markdown underlying these docs is available on [GitHub](https://raw.githubusercontent.com/amb26/ponder/refs/heads/main/content/docs/fluid-view.md),
suitable for direct ingestion by your friendly local neighbourhood intelligence.
## A first component
A Single File Component is a `.vue` file holding a `
Clicked @{count} times
```
* `@{count}` in text or an attribute value binds live to the component's `count` member.
* `@onclick="{self}.increment()"` invokes the component's `increment` method when the button is clicked.
* `self.count++` writes through the component proxy into its live layer. The text node updates, and nothing else
in the DOM is touched.
To use it, declare the module and import the SFC in a host page, and mark an element with the layers to instantiate
on it:
```html
```
* `` registers a module root, referred to in paths as `%id`.
* `` loads an SFC on demand. The layer name defaults to the file name with `-` replaced by
`.`, so `my-counter.vue` must define `my.counter`.
* `fluid-layers="layerA layerB"` on any element instantiates a component with those layers, rendering into that
element. The element is watched live: elements added to the document later are booted too.
A component can equally be created from JavaScript with `my.counter({container: element})`, which renders into
`element`.
### What the SFC loader does
When the SFC is loaded, its script is patched before execution:
* `$layers` defaults to `["fluid.component", "fluid.sfcLayer"]`.
* A `view` subcomponent is added, with layer `fluid.sfcTemplateViewComponent`, whose `template` refers to the SFC's
`` block as `{sfcLayer: "my.counter"}` (see [Views](#views)). Since this is an ordinary member of the view,
a layer derived from the SFC's layer may replace the template by supplying its own, e.g.
`view: {$component: {template: "
...
"}}`, whilst keeping the rest of the SFC's definition.
* Each `