Contextual editing with the Svelte SDK

Developer preview

This feature is in developer preview. Use with caution as it may change unexpectedly. For more information, contact us.

The SDK provides built-in support for Uniform's visual/contextual editing. When a composition is opened in the Uniform Canvas editor, the SDK automatically:

  1. Listens for composition update messages from the editor
  2. Re-renders the component tree with the updated data
  3. Enables inline editing for UniformText and UniformRichText components
  4. Annotates components with editing attributes for the Canvas UI

For custom contextual editing setups, use getUniformContextualEditing directly:

<script lang="ts"> import { getUniformContextualEditing } from '@uniformdev/canvas-svelte'; const { composition, isContextualEditing } = getUniformContextualEditing({ initialCompositionValue: compositionData, enhance: (message) => message.composition, }); </script>
Return ValueTypeDescription
compositionreactive RootComponentInstanceThe current composition (updates during editing)
isContextualEditingreactive booleanWhether the app is in contextual editing mode