Recurrence editor example

Finite repeats across a time-zone transition.

Stage a daily or weekly rule, inspect exact UTC instants and local offsets, then apply or discard it. The local reference source keeps revisions separate from the draft.

Complete React client module · MIT · Next.js and Vite

Interactive example

Finite repeats across a time-zone transition

Stage a daily or weekly rule, inspect exact UTC instants and local offsets, then apply or discard it. The local reference source keeps revisions separate from the draft.

Keyboard

  • Use native field editing and Select keyboard navigation. Weekly choices use Tab and Space.
  • Apply validates the complete finite rule and focuses a linked error. Escape or Cancel discards the staged change.
  • The original wall-clock time and explicit DST policy determine each instant; no browser-zone conversion is inferred.

States covered

  • Daily and weekly
  • Count or inclusive until date
  • Explicit IANA zone
  • DST disambiguation
  • Staged Apply/Cancel
  • Read only
  • Scoped RTL

Install this complete example and its component dependencies.

Terminal
npx shadcn@latest add https://ui.bld8.dev/r/example-recurrence-finite-rule.json
Complete source
React / TypeScript
/*!
MIT License

Copyright (c) 2026 Jaison

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/
'use client';
import '@bld8/ui/styles.css';
import {useMemo,useState} from 'react';
import {Button,Checkbox,RecurrenceEditor,createMemoryRecurrenceSource,type RecurrenceSeries,type RecurrenceSource,UIProvider} from '@bld8/ui';
const initial:RecurrenceSeries={id:'review-series',revision:1,title:'Interface review',resourceId:'room-a',rule:{frequency:'daily',interval:1,startDate:'2026-10-01',time:'09:00',timeZone:'Australia/Melbourne',durationMinutes:45,count:5,disambiguation:'reject'},exceptions:[]};
export default function FiniteRecurrenceExample(){const store=useMemo(()=>createMemoryRecurrenceSource(initial),[]),[series,setSeries]=useState(initial),[readOnly,setReadOnly]=useState(false),[arabic,setArabic]=useState(false),[attempts,setAttempts]=useState(0);const source=useMemo<RecurrenceSource>(()=>({load:()=>store.load(),save:async(request,context)=>{setAttempts(value=>value+1);return store.save(request,context);}}),[store]);return <UIProvider locale={arabic?'ar':'en-AU'} direction={arabic?'rtl':'ltr'} messages={arabic?{'recurrence.scope':'نطاق التعديل','recurrence.entire':'السلسلة كاملة','recurrence.one':'موعد واحد','recurrence.rule':'قاعدة التكرار','recurrence.frequency':'التواتر','recurrence.daily':'يومي','recurrence.weekly':'أسبوعي','recurrence.every':'التكرار كل','recurrence.firstDate':'التاريخ الأول','recurrence.wallTime':'وقت البدء المحلي','recurrence.zone':'المنطقة الزمنية','recurrence.duration':'دقائق منقضية','recurrence.dst':'الأوقات المحلية المتكررة أو المفقودة','recurrence.end':'نهاية السلسلة','recurrence.byCount':'بعد عدد من المواعيد','recurrence.byDate':'حتى تاريخ','recurrence.count':'عدد المواعيد الأساسية','recurrence.preview':'معاينة المواعيد','recurrence.apply':'تطبيق التغيير','recurrence.cancel':'إلغاء المسودة'}:{}}><div style={{display:'grid',gap:24,maxWidth:900}}>
  <div style={{display:'flex',gap:16,flexWrap:'wrap'}}><Checkbox label="Read-only recurrence" checked={readOnly} onCheckedChange={setReadOnly}/><Button variant="ghost" onClick={()=>setArabic(value=>!value)}>{arabic?'Use English recurrence':'Use Arabic recurrence'}</Button></div>
  <RecurrenceEditor label="Review recurrence" series={series} source={source} onSeriesChange={setSeries} readOnly={readOnly} resources={[{id:'room-a',label:'Review room'}]}/><p className="bui-hint" data-recurrence-host>{'Host revision: '+series.revision+' | Save attempts: '+attempts}</p>
</div></UIProvider>;}