Tarikh
Reference

React Components

Use Tarikh React components when you want semantic date output and predictable accessibility.

Start Here

Import from @coreify/tarikh/react when you want semantic <time> output in React.

What You Get

ComponentUse it for
TarikhStandard date rendering
Tarikh.RelativeRelative time like today or yesterday
Tarikh.BanglaBangla calendar output
Tarikh.HijriHijri calendar output
import { Tarikh } from "@coreify/tarikh/react";

const date = "2026-03-31";

<Tarikh value={date} preset="dateTime" />
<Tarikh.Relative value={date} relativeStyle="short" />
<Tarikh.Bangla value={date} locale="bn-BD" />
<Tarikh.Hijri value={date} locale="bn-BD" hijriSystem="islamic-civil" />

Common Props

PropBehavior
valueAccepts Date, timestamps, and date strings
srLabelOverrides the generated aria-label
aria-labelUsed when srLabel is not provided

All components render semantic <time> elements with dateTime and aria-label.

Relative Props

Tarikh.Relative uses relativeStyle instead of style so it does not collide with the native React style prop.

<Tarikh.Relative
  value="2026-03-31T10:00:00Z"
  baseDate="2026-03-31T12:00:00Z"
  relativeStyle="short"
/>

Example

import { Tarikh } from "@coreify/tarikh/react";

export function CardDate() {
  return (
    <Tarikh
      value="2026-03-31"
      locale="bn-BD"
      preset="date"
      srLabel="Published date"
    />
  );
}

Notes

DetailNotes
SemanticsRenders <time> elements with dateTime and aria-label
RuntimeSSR-safe, tree-shakeable, and zero runtime dependencies beyond React
ScopeKeep React imports isolated under @coreify/tarikh/react

On this page