intro option is set to false.
Parameters
The Svelte component to mount
Configuration options for mounting the component
Target element where the component will be mounted
Optional node inside
target. When specified, the component is rendered immediately before itComponent properties. Required if the component expects props
Whether or not to play transitions on initial render
Can be accessed via
getContext() at the component levelAllows the specification of events. Use callback props instead
A function that transforms errors caught by error boundaries before they are passed to the
failed snippet. Defaults to the identity functionReturns
The component’s exports (and potentially the props if compiled with
accessors: true)Examples
Basic usage
Mounting with anchor
Disabling intro transitions
With context
Notes
- In Svelte 5, components are functions, not classes. Use
mount()instead ofnew Component() - The component is mounted synchronously
- To unmount the component later, use the
unmount()function - See the migration guide for more information about the change from Svelte 4