Open-Awesome
CategoriesAlternativesStacksSelf-HostedExplore
Open-Awesome

© 2026 Open-Awesome. Curated for the developer elite.

TermsPrivacyAboutGitHubRSS
  1. Home
  2. Preact
  3. Preact Cycle

Preact Cycle

MITJavaScript0.5.1

A minimal functional-reactive Virtual DOM rendering library built on Preact for state management.

Visit WebsiteGitHubGitHub
143 stars12 forks0 contributors

What is Preact Cycle?

Preact-cycle is a minimal functional-reactive Virtual DOM rendering library built on Preact. It provides a simple way to manage state using pure functions and reducers, enabling developers to create interactive UIs with predictable state updates. The library integrates seamlessly with Preact components, offering context-based mutations for easy state manipulation across the component tree.

Target Audience

Frontend developers using Preact who want a lightweight, functional approach to state management without the overhead of larger frameworks. It's ideal for those building small to medium-sized interactive applications with a focus on simplicity and performance.

Value Proposition

Developers choose Preact-cycle for its minimal API and seamless integration with Preact, offering a functional-reactive state management solution that reduces boilerplate and promotes clean, predictable code. Its context-based mutations simplify state updates across components, making it a practical alternative to more complex state libraries.

Overview

:recycle: Minimal functional Virtual DOM rendering using Preact :bike:

Use Cases

Best For

  • Building interactive UIs with Preact and functional state management
  • Creating small to medium-sized applications with minimal state management overhead
  • Implementing reactive components using pure functions and reducers
  • Developing component-based applications with context-driven state updates
  • Prototyping or building lightweight frontend projects with Preact
  • Managing state in Preact apps without adopting a full-fledged state library

Not Ideal For

  • Large-scale applications requiring advanced state management features like middleware or time-travel debugging
  • Teams that prefer class-based components or object-oriented programming patterns over functional approaches
  • Projects needing extensive third-party integrations or a mature ecosystem with plugins and tools
  • Applications demanding server-side rendering or static site generation, as support isn't mentioned in the README

Pros & Cons

Pros

Minimal API Surface

The library focuses on essential functions like render, h, mutate, and mutation, reducing boilerplate and learning curve, as shown in the simple example with just a few lines of code.

Functional State Updates

State changes are handled through pure functions (reducers) like ADD and REMOVE, promoting predictable and testable code, as demonstrated in the to-do list examples.

Seamless Preact Integration

Built directly on Preact, it leverages Preact's efficient Virtual DOM rendering without adding significant overhead, making it a natural fit for Preact-based projects.

Context-Driven Mutations

Mutate and mutation are available as context properties, automatically passed through the component tree, simplifying state updates in nested components, as seen in the component-based example.

Cons

Niche Ecosystem

As a smaller library focused on Preact, it lacks the extensive community, plugins, and tools found with more popular state management solutions like Redux or MobX.

Immutability Not Enforced

The README shows that mutating state in-place is allowed but discouraged (e.g., the TOGGLE reducer), which can lead to hard-to-debug issues if developers aren't disciplined.

No Built-in DevTools

There's no mention of debugging tools or development integrations, making state inspection and debugging more challenging compared to libraries with dedicated devtools.

Preact Dependency

It's tightly coupled with Preact, so it's not usable with other frameworks, limiting flexibility and potentially locking users into the Preact ecosystem.

Frequently Asked Questions

Quick Stats

Stars143
Forks12
Contributors0
Open Issues2
Last commit8 years ago
CreatedSince 2016

Tags

#preact-components#functional-programming#frontend#javascript-library#ui-components#reactive-ui#preact#virtual-dom#state-management

Built With

P
Preact
J
JavaScript

Links & Resources

Website

Included in

Preact987
Auto-fetched 1 day ago

Related Projects

Preact CompatPreact Compat

ATTENTION: The React compatibility layer for Preact has moved to the main preact repo.

Stars943
Forks124
Last commit4 years ago
Preact Render To StringPreact Render To String

📄 Universal rendering for Preact: render JSX and Preact components to HTML.

Stars728
Forks102
Last commit8 days ago
Preact Material ComponentsPreact Material Components

preact wrapper for "Material Components for the web"

Stars553
Forks84
Last commit5 years ago
Preact Virtual ListPreact Virtual List

:card_index: Virtual List that only renders visible items. Supports millions of rows.

Stars230
Forks24
Last commit7 years ago
Community-curated · Updated weekly · 100% open source

Found a gem we're missing?

Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.

Submit a projectStar on GitHub