Skip to content

Commit 31caddb

Browse files
committed
Added spectrum button component to display additional Svelte/UXP functionality
1 parent e8e0a60 commit 31caddb

File tree

2 files changed

+34
-1
lines changed

2 files changed

+34
-1
lines changed

ui-svelte-starter/src/App.svelte

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
<script>
2-
import { onMount } from "svelte";
2+
import UXPButton from './UXPButton.svelte';
3+
import { onMount } from 'svelte';
34
45
let count = 0;
56
onMount(() => {
@@ -18,6 +19,7 @@
1819
<sp-heading>Plugin has been open for {count} seconds.</sp-heading>
1920
<sp-detail>Visit the <a href="https://www.adobe.io/photoshop/uxp/">UXP documentation</a> to learn how to build plugins for Photoshop.</sp-detail>
2021
</div>
22+
<UXPButton variant="primary" icon="ChevronRightSmall" href="https://svelte.dev/"/>
2123
</div>
2224

2325
<style>
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
<script>
2+
export let variant;
3+
export let icon;
4+
export let href;
5+
</script>
6+
7+
<div class="container">
8+
<sp-icons-medium></sp-icons-medium>
9+
<sp-button {variant} quiet>
10+
{#if icon}
11+
<sp-icon name="ui:{icon}" size="xxs" slot="icon"></sp-icon>
12+
{/if}
13+
<a {href}>Try Svelte</a>
14+
</sp-button>
15+
</div>
16+
17+
<style>
18+
.container {
19+
margin-top: 3px;
20+
padding: 2px;
21+
}
22+
23+
sp-button a {
24+
color: var(--uxp-host-text-color);
25+
text-decoration: none;
26+
}
27+
28+
sp-button a:hover {
29+
text-decoration: none;
30+
}
31+
</style>

0 commit comments

Comments
 (0)