Learn full-stack web development using fastn in a week
Learn Now
Kernel Components

Kernel Components

fastn comes with a few kernel components, these components are the building blocks for building all other components.
fastn supports importing one document from another, and the imported documents act as a namespace.
All kernel components are defined in a virtual document, named ftd, and every .ftd file implicitly imports ftd:
hello world using ftd.text
-- import: ftd

-- ftd.text: hello world

The import line is not needed as it's automatically imported. This line defines namespace ftd, so all kernel components are referred as ftd.text and so on.

We are then using a component named ftd.text to render the text "hello world" in the UI.