Something went wrong. Try again.
[READ-ONLY] Mirror of https://github.com/flo-bit/ui-kit. 🦊 fox ui, svelte 5 and tailwind 4 flo-bit.dev/ui-kit
Something went wrong. Try again.
1234567891011121314151617181920212223242526272829<script lang="ts"> import { Box, Button } from '@foxui/all'; import { Timer, TimerState } from '@foxui/all'; import { onMount } from 'svelte';
let timer: TimerState | undefined = $state(undefined);
onMount(() => { timer?.start(); });</script>
<Box class="min-h-0"> <Timer bind:timer class="sm:text-7xl" /></Box>
<div class="mt-2 flex w-full justify-center gap-2"> <Button onclick={() => { if (timer?.isRunning) { timer?.pause(); } else { timer?.resume(); } }}>{timer?.isRunning ? 'Pause' : 'Start'}</Button > <Button onclick={() => timer?.reset()}>Reset</Button></div>