Join our Discord Community
Time

Relative Time

Multi-timezone time display component for React and Next.js applications. Built with TypeScript support, Tailwind CSS styling, and shadcn/ui design featuring auto-updates, custom formatting, and controlled time states.

Loading component...

Installation

npx shadcn@latest add https://www.shadcn.io/registry/relative-time.json
npx shadcn@latest add https://www.shadcn.io/registry/relative-time.json
pnpm dlx shadcn@latest add https://www.shadcn.io/registry/relative-time.json
bunx shadcn@latest add https://www.shadcn.io/registry/relative-time.json

Features

  • Multi-timezone display - Simultaneous time zones with labeled formatting using JavaScript Date APIs
  • Auto-updating - Real-time updates every second with controlled state options for React applications
  • Custom formatting - Configurable date and time display patterns using TypeScript props
  • Controlled/uncontrolled - Flexible state management for time manipulation in Next.js projects
  • Responsive layout - Flex positioning with clean minimal UI using Tailwind CSS utilities
  • Performance optimized - Efficient interval management with proper cleanup using shadcn/ui patterns
  • Open source - Free timezone component with customizable appearance and formatting

Examples

Custom date format

Loading component...

Custom time format

Loading component...

Controlled time

Loading component...

Use Cases

  • Global applications - Multi-region time displays for international teams
  • Meeting schedulers - Timezone-aware appointment and event planning
  • Dashboard widgets - Real-time clock displays for monitoring interfaces
  • Travel applications - Multiple location time tracking for itineraries

Implementation

Built with native Date APIs for timezone handling. Uses setInterval for auto-updates with proper cleanup. Supports custom formatters and controlled time states. Responsive design with minimal UI.