Skip to content
Cojeev UI

Focus session

Composition

A local focus timer composed from Cojeev cards, progress, badges and native controls.

React · copy into your project · light and dark themes

Try it

Loading preview…

Take it with you

Copy the example, API and usage notes for your editor or AI assistant.

Add to your project

Terminal
npx shadcn@latest add https://luv-jeri.github.io/cojeev-ui/r/focus-session.json

The 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:

Terminal
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.json

Using 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

restrunningpausedcompletereduced-motion

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.