VoidShell/widget/MyButton.tsx
2024-10-31 15:39:18 -06:00

16 lines
307 B
TypeScript

import { Variable, bind } from "astal";
export function MyButton(): JSX.Element {
const count = Variable(0);
function increment() {
count.set(count.get() + 1);
}
return (
<button onClicked={increment}>
<label label={bind(count).as((num) => `Count: ${num}`)} />
</button>
);
}