Hulian UIv0.93.5413 components0 components
  • Start
  • Components
  • Blocks
  • Pages
  • Demos
  • Changelog
ChineseEnglish
  • ComponentsComponents
  • ThemeTheme

Windows

  • Safari
  • WindowFrame
  • Chrome
  • Terminal

Devices

  • iPhone
  • Android
  • Tablet
  • Watch

Watch

watch

Frames compact content inside a smartwatch device mockup.

Usage

Basic usage

Fill the dial content with children, the default is Series 45mm model.

10:09Hulian
tsx
<Watch model="series-45">
  <div className="flex h-full w-full flex-col items-center justify-center">
    <span className="text-base font-semibold">10:09</span>
    <span className="text-[10px] text-muted-foreground">Hulian</span>
  </div>
</Watch>

Default model

model determines the case size: Ultra 49mm is the largest, Series 41mm is the smallest.

10:09Hulian
10:09Hulian
10:09Hulian
tsx
<>
  <Watch model="ultra-49"><Face /></Watch>
  <Watch model="series-45"><Face /></Watch>
  <Watch model="series-41"><Face /></Watch>
</>

Custom width

width takes precedence over the model preset when passed in explicitly, allowing precise control of the case size.

10:09Hulian
tsx
<Watch width={140}>
  <Face />
</Watch>

Picture dial

imageSrc takes priority over children, and the entire picture is filled with cover on the dial.

Picture dial
tsx
<Watch model="series-45" imageSrc="/face.png" />

When to Use

Use it to present a screenshot or rendered watch UI inside an Apple Watch-style case. Pair it with iPhone and Tablet device frames when a product story spans phone, tablet, and watch surfaces.

Import

ts
import { Watch, WATCH_MODELS } from "@hulianui/ui"

Props

NameTypeDefaultDescription
model"ultra-49" | "series-45" | "se-44" | "series-41"-Optional model used to resolve the case width; the component itself has no model default
widthnumberModel width, or 184 without a modelCase width in pixels; an explicit value takes precedence over model
imageSrcstring-The image address of the dial content, taking precedence over children
Extends ComponentPropsWithoutRef<"div">, forwarding className, style, and other native attributes. WATCH_MODELS exports widths for ultra-49 (210), series-45 (190), se-44 (184), and series-41 (172).

Slots

SlotTypeDescription
childrenReactNodeDial content rendered when imageSrc is not provided

Usage Guidelines

  • Body height is derived from the screen ratio and the border, never a hard-coded aspectRatio. The border is a fixed pixel value while the screen scales with the width, so the body ratio is not a constant: the same device drawn at 280px and at 360px has two different body ratios. A hard-coded ratio therefore skews the inner screen at some widths, and PreviewSandbox fit scaling leaves a white band on the short edge (#117). The logical screen resolution and border width live in lib/device-metrics, and a unit test locks the invariant that the inner screen ratio always equals the declared screen ratio.

This is a presentational RSC with no interaction state. When both imageSrc and children are provided, imageSrc wins.

Related

iPhone · Android · Tablet · Safari · Chrome · Terminal

Playground

10:09Hulian
<Watch model="series-45">
  <img src="/face.png" />
</Watch>
PreviousTabletDevice MockupsNextTabBar

On this page

  • Usage
  • Documentation
    • When to Use
    • Import
    • Props
    • Slots
    • Usage Guidelines
    • Related
  • Playground