Focus session
CompositionA local focus timer composed from Cojeev cards, progress, badges and native controls.
Try it
Add to your project
npx shadcn@latest add https://luv-jeri.github.io/cojeev-ui/r/focus-session.jsonThe command includes the component’s shared dependencies. Your project keeps editable source files.
Include the complete example
This example also composes organism-composition, toggle-group, typography. Install its parts together:
npx shadcn@latest add https://luv-jeri.github.io/cojeev-ui/r/focus-session.json https://luv-jeri.github.io/cojeev-ui/r/organism-composition.json https://luv-jeri.github.io/cojeev-ui/r/toggle-group.json https://luv-jeri.github.io/cojeev-ui/r/typography.jsonUsing focus session
Import FocusSession from the focus-session entry. Set durationSeconds (default 1500, bounded to 1–86400) and optional name or description.
Start, pause and reset the real local countdown. Changing duration resets the session; the example's 5, 15 and 25 minute choices each begin a fresh session.
Use onAction for start, pause, reset and complete events. OrganismProps also supports controlled state/onStateChange and assembly presentation.
The documentation timer is a local demo. It does not create a reminder, notification or saved task, and reloading clears its state.
API
Compose the exported parts below. The prop types are read from the React source during the registry build.
Native element or underlying primitive props are inherited where declared, including accessible labels, event handlers and refs.
Accessibility
Native buttons support keyboard activation. Remaining time and progress stay available as readable values.
Reduced motion and global Off preserve the usable timer; decorative motion is independent of elapsed time.
States and appearance
For conditional content, keep a MotionPresence boundary around keyed MotionSurface children. The shared entrance and exit states work with native primitives and respect your motion preference.
Try pointer and keyboard interaction, and switch the appearance control in the navigation to compare light and dark mode. Motion respects reduced motion preferences.