API Reference
Render
<Render/>
provides more control and complexity when rendering Svelte components. It is used in conjuction with createRender
to define custom components for headers, footers, and data cells.
Usage
<Render/>
takes a single prop of
with RenderConfig
type.
RenderConfig
RenderConfig
can either be:
- a
string
ornumber
for static content - a
Readable<string>
orReadable<number>
for dynamic content - a
ComponentRenderConfig
returned fromcreateRender
for Svelte component content
NOTE
ComponentRenderConfig
can either be static or dynamic depending on its prop type. See also createRender
.
Render#of: string | number
Renders a simple text node.
<Render of="Hello, world" />
Hello, world
Render#of: Readable<string | number>
Renders a simple reactive text node.
<script>
const pageY = writable(0);
</script>
<svelte:window bind:scrollY={$pageY} />
<Render of={pageY} />
0
Render#of: ComponentRenderConfig
Renders a Svelte component with props. ComponentRenderConfig
is created with createRender
.
<script>
import Profile from './Profile.svelte';
const profile = createRender(Profile, {
name: 'Alan Turing'
});
</script>
<Render of={profile} />
Alan Turing