Clock
An analog clock face — the home-screen widget, for a dashboard.
Walkthrough
1. Basic
A live clock — no props. It keeps the time now, steps the second hand on a small spring, and reads out as "10:42 AM" to a screen reader.
<script lang="ts"> import { Clock } from 'omaris';</script><Clock /> 2. Styles
shape is any outline from the shape library, hands and markers pick the dial, and variant × tone colour it the way they colour a button.
<script lang="ts"> import { Clock } from 'omaris';</script><div class="flex flex-wrap items-start gap-6"> <Clock value="10:09:36" size="8rem" /> <Clock value="10:09:36" size="8rem" shape="circle" hands="classic" markers="full" /> <Clock value="10:09:36" size="8rem" shape="square" hands="minimal" markers="dots" variant="filled" tone="primary" /> <Clock value="10:09:36" size="8rem" shape="clover-8" markers="quarters" tone="tertiary" /> <Clock value="10:09:36" size="8rem" shape="cookie-9" variant="outline" markers="ticks" /></div> 3. World clocks
timeZone makes a world clock, and label with showTime captions it — the strip across the top of an operations dashboard. Each one keeps its own zone's time, always 12-hour.
<script lang="ts"> import { Card, Clock } from 'omaris'; const offices = [ { city: 'Baghdad', zone: 'Asia/Baghdad', tone: 'primary' }, { city: 'London', zone: 'Europe/London', tone: 'secondary' }, { city: 'New York', zone: 'America/New_York', tone: 'tertiary' }, { city: 'Tokyo', zone: 'Asia/Tokyo', tone: 'info' } ] as const;</script><Card class="grid w-full grid-cols-2 gap-4 p-4 sm:grid-cols-4"> {#each offices as office (office.city)} <Clock class="mx-auto" timeZone={office.zone} tone={office.tone} label={office.city} showTime size="6.5rem" /> {/each}</Card> 4. Overridden
classes reaches every part — the face, each hand, the pin, the caption — and the face shrinks to a narrow container rather than overflowing it.
<script lang="ts"> import { Clock } from 'omaris';</script><div class="w-32"> <Clock value="18:45" size="12rem" seconds={false} label="Close of business" showTime class="w-full" classes={{ face: 'fill-tertiary-container', hour: 'stroke-tertiary', minute: 'stroke-primary', label: 'text-label-lg' }} /></div>