diff --git a/packages/client/src/sdk.js b/packages/client/src/sdk.js
index 1a3a4177a8..7eef69441d 100644
--- a/packages/client/src/sdk.js
+++ b/packages/client/src/sdk.js
@@ -7,6 +7,7 @@ import {
builderStore,
} from "./store"
import { styleable } from "./utils/styleable"
+import transition from "./utils/transition"
import { linkable } from "./utils/linkable"
import Provider from "./components/Provider.svelte"
import { ActionTypes } from "./constants"
@@ -19,6 +20,7 @@ export default {
screenStore,
builderStore,
styleable,
+ transition,
linkable,
Provider,
ActionTypes,
diff --git a/packages/client/src/utils/transition.js b/packages/client/src/utils/transition.js
new file mode 100644
index 0000000000..14470ddea2
--- /dev/null
+++ b/packages/client/src/utils/transition.js
@@ -0,0 +1,14 @@
+import { fade, blur, slide, fly } from 'svelte/transition'
+
+// Default options
+const transitions = new Map([
+ ["fade", { tn: fade, opt: {} }],
+ ["blur", { tn: blur, opt: {} }],
+ ["slide", { tn: slide, opt: {} }],
+ ["fly", { tn: fly, opt: { y: 30 } }],
+])
+
+export default function transition(node, {type, options = {}}) {
+ const { tn, opt } = transitions.get(type) || {}
+ return tn ? tn(node, {...opt, ...options}) : fade(node, { duration: 0})
+}
\ No newline at end of file
diff --git a/packages/standard-components/manifest.json b/packages/standard-components/manifest.json
index cb321f1bb9..f3a045a062 100644
--- a/packages/standard-components/manifest.json
+++ b/packages/standard-components/manifest.json
@@ -291,6 +291,13 @@
"type": "text",
"label": "URL",
"key": "url"
+ },
+ {
+ "type": "select",
+ "key": "transitionType",
+ "label": "Transition",
+ "options": ["fade", "blur", "slide", "fly"],
+ "defaultValue": ""
}
]
},
diff --git a/packages/standard-components/src/Image.svelte b/packages/standard-components/src/Image.svelte
index b54c84e691..97df5d642f 100644
--- a/packages/standard-components/src/Image.svelte
+++ b/packages/standard-components/src/Image.svelte
@@ -1,7 +1,7 @@
+ use:styleable={$component.styles}
+ in:transition={{type: transitionType}} />