TinyBase logoTinyBase β

Using Svelte DOM Components

The reactive components in the ui-svelte-dom module let you declaratively display parts of a Store in a web browser, where Svelte's DOM runtime is available.

These are generally implementations of the components we discussed in the previous guide, but are specifically designed to render HTML table content in a browser.

Styling and class names are intentionally basic, since you are expected to style them with CSS to fit your app's overall visual language.

The easiest way to understand these components is to see them in action in the UI Components (Svelte) demos:

ComponentPurpose
ValuesInHtmlTableRenders Values.demo
TableInHtmlTableRenders a Table.demo
SortedTableInHtmlTableRenders a sorted Table, with optional interactivity.demo
SliceInHtmlTableRenders a Slice from an Index.demo
RelationshipInHtmlTableRenders the local and remote Tables of a relationship.demo
ResultTableInHtmlTableRenders a ResultTable.demo
ResultSortedTableInHtmlTableRenders a sorted ResultTable, with optional interactivity.demo
EditableValueViewRenders a Value and lets you change its type/value.demo
EditableCellViewRenders a Cell and lets you change its type/value.demo

Like ui-svelte itself, the module uses Svelte components rather than React components, so customization is done by passing component constructors, not functions that return JSX.

The demos intentionally mirror the React DOM set so it is easy to compare the framework-specific code side by side.

If you also want a development overlay for inspecting and editing Stores, Indexes, Relationships, Queries, and other TinyBase objects, use the ui-svelte-inspector module and the <Inspector /> (Svelte) demo.

This concludes the UI-focused guides. Next we move on to schemas and persistence in the Schemas guide.