Skip to content

Commit 0a3a026

Browse files
committed
add Button example
1 parent 3c2bc6b commit 0a3a026

File tree

6 files changed

+106
-0
lines changed

6 files changed

+106
-0
lines changed
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import { component$ } from '@builder.io/qwik';
2+
import { SfButton } from 'qwik-storefront-ui';
3+
4+
export default component$(() => {
5+
return (
6+
<div class="flex flex-col items-center space-y-4 xs:block xs:space-x-4">
7+
<SfButton as="a" href="/">
8+
Link
9+
</SfButton>
10+
</div>
11+
);
12+
});
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import { component$ } from '@builder.io/qwik';
2+
import { SfButton } from 'qwik-storefront-ui';
3+
4+
export default component$(() => {
5+
return (
6+
<SfButton type="button" class="w-full">
7+
Hello
8+
</SfButton>
9+
);
10+
});
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
import { component$ } from '@builder.io/qwik';
2+
import {
3+
SfButton,
4+
SfIconHome,
5+
SfIconShoppingCart,
6+
SfIconStar,
7+
} from 'qwik-storefront-ui';
8+
9+
export default component$(() => {
10+
return (
11+
<div class="flex flex-col items-center space-y-4 xs:flex-row xs:space-y-0 xs:space-x-4">
12+
<SfButton>
13+
<div q:slot="prefix">
14+
<SfIconHome />
15+
</div>
16+
Home
17+
</SfButton>
18+
19+
<SfButton>
20+
<div q:slot="suffix">
21+
<SfIconStar />
22+
</div>
23+
Hello
24+
</SfButton>
25+
26+
<SfButton type="button" square aria-label="Add to cart">
27+
<SfIconShoppingCart />
28+
</SfButton>
29+
</div>
30+
);
31+
});
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
import { component$ } from '@builder.io/qwik';
2+
import { SfButton } from 'qwik-storefront-ui';
3+
4+
export default component$(() => {
5+
return (
6+
<div class="flex flex-col items-center space-y-4 xs:block xs:space-x-4">
7+
<SfButton type="button" size="sm">
8+
Hello
9+
</SfButton>
10+
11+
<SfButton type="button" size="base">
12+
Hello
13+
</SfButton>
14+
15+
<SfButton type="button" size="lg">
16+
Hello
17+
</SfButton>
18+
</div>
19+
);
20+
});
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import { component$ } from '@builder.io/qwik';
2+
import { SfButton } from 'qwik-storefront-ui';
3+
4+
export default component$(() => {
5+
return (
6+
<SfButton>
7+
<span class="truncate max-w-[200px]">
8+
{' '}
9+
Too long description for button{' '}
10+
</span>
11+
</SfButton>
12+
);
13+
});
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
import { component$ } from '@builder.io/qwik';
2+
import { SfButton } from 'qwik-storefront-ui';
3+
4+
export default component$(() => {
5+
return (
6+
<div class="flex flex-col items-center space-y-4 xs:block xs:space-x-4">
7+
<SfButton type="button" variant="primary">
8+
Hello
9+
</SfButton>
10+
11+
<SfButton type="button" variant="secondary">
12+
Hello
13+
</SfButton>
14+
15+
<SfButton type="button" variant="tertiary">
16+
Hello
17+
</SfButton>
18+
</div>
19+
);
20+
});

0 commit comments

Comments
 (0)