Components (JSX)

Dynamic

Renders an arbitrary custom or native component and forwards the other props. JSX form of dynamic() — same primitive, picked at the JSX site.

<Dynamic> is the JSX convenience wrapper for dynamic(). Prefer dynamic() when you need a reusable stable component reference.


Import

import { Dynamic } from "@solidjs/web";

Type signature

function Dynamic<T extends ValidComponent>(props: DynamicProps<T>): JSX.Element;

Examples

<Dynamic
component={multiline() ? RichTextEditor : "input"}
value={value()}
onInput={onInput}
/>

DynamicProps

type DynamicProps<T extends ValidComponent, P = ComponentProps<T>> = {
[K in keyof P]: P[K];
} & {
component: T | null | undefined | false;
};
Last updated: 7/4/26, 6:21 PMEdit this pageReport an issue with this page