Reference
Reference
Reach React components, parsing details, TypeScript contracts, examples, and the why behind Tarikh.
Start Here
Use this section when you already know the job and need the implementation details, type surface, or a copy-paste example.
| Need | Start here |
|---|---|
| Semantic React output | React Components |
| Server-side parsing and formatting | Parsing and Server Use |
Why Tarikh exists instead of plain Intl | Intl Comparison |
| TypeScript contracts and public types | TypeScript |
| Copy-paste examples | Examples |
Quick Rule
If you want to render dates in React, start with @coreify/tarikh/react.
If you want to understand supported inputs and parsing behavior, open parsing and server use.
If you want to check contracts before wiring the API, open TypeScript.
React Components
| Export | Use it for |
|---|---|
Tarikh | Default semantic <time> rendering |
Tarikh.Relative | Relative labels like today, yesterday, and tomorrow |
Tarikh.Bangla | Bangla calendar output in React |
Tarikh.Hijri | Hijri calendar output in React |
When To Use Tarikh Instead Of Intl
See Intl Comparison for the full side-by-side breakdown of what Intl.DateTimeFormat cannot cover.
TypeScript
| Type | Purpose |
|---|---|
FormatOptions | Primary object-based formatting contract |
TarikhProps | Props for the main React <Tarikh /> component |
HIJRI_TIME_ZONES | Canonical supported Hijri time zones (Asia/Dhaka, UTC) |
| Type-level contract | When using pattern, mode is intentionally disallowed in TypeScript |
Common Paths
| Task | What to read |
|---|---|
Render <time> in React | React Components |
| Parse on the server or in scripts | Parsing and Server Use |
Decide whether Intl is enough | Intl Comparison |
| Check public types before coding | TypeScript |
| Copy an example into your app | Examples |