Layout Plugin
By default, Reactlit uses a simple layout system where each display
call
concatenates a ReactNode
to the DOM. This works great for simple applications,
where you are ok just showing your content in a single column,
but as your application grows, you may want to have more control over the layout.
The plugin provides a layout
helper function to let you define more custom layouts with
your Reactlit script.
The layout
function works via the tunnel-rat
library. It takes a number of slots to expose and a render function that defines how
those slots are layed out. Then, for each slot, it returns a mini-context with
view
and display
functions that render specifically within that slot.
This is a bit abstract, so let’s look at an example.