Skip to content

Commit c65bccc

Browse files
authored
Drop expired webcomponents.dev link (#2492)
1 parent 472c007 commit c65bccc

File tree

2 files changed

+34
-1
lines changed

2 files changed

+34
-1
lines changed

packages/solid-element/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ This library extends [Solid](https://github.com/solidjs/solid) by adding Custom
88

99
## Example
1010

11-
[See here](https://webcomponents.dev/edit/yGRb00wV4AMncPupRmA9) for an example of a webcomponent created by `solid-element`.
11+
[See here](./sample.jsx) for an example of a webcomponent created by `solid-element`.
1212

1313
## Installation
1414

packages/solid-element/sample.jsx

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
import { createSignal } from "solid-js";
2+
import { customElement } from "solid-element";
3+
4+
const style = `div * {
5+
font-size: 200%;
6+
}
7+
8+
span {
9+
width: 4rem;
10+
display: inline-block;
11+
text-align: center;
12+
}
13+
14+
button {
15+
width: 4rem;
16+
height: 4rem;
17+
border: none;
18+
border-radius: 10px;
19+
background-color: seagreen;
20+
color: white;
21+
}`;
22+
23+
customElement("my-counter", () => {
24+
const [count, setCount] = createSignal(0);
25+
return (
26+
<div>
27+
<style>{style}</style>
28+
<button onClick={() => setCount(count() - 1)}>-</button>
29+
<span>{count}</span>
30+
<button onClick={() => setCount(count() + 1)}>+</button>
31+
</div>
32+
);
33+
});

0 commit comments

Comments
 (0)