LearnNewsExamplesServices
Frontmatter
id7087
titleIntroduce Functional Button Component
stateClosed
labels
enhancement
assigneestobiu
createdAtJul 21, 2025, 1:11 PM
updatedAtJul 21, 2025, 1:17 PM
githubUrlhttps://github.com/neomjs/neo/issues/7087
authortobiu
commentsCount0
parentIssuenull
subIssues[]
subIssuesCompleted0
subIssuesTotal0
blockedBy[]
blocking[]
closedAtJul 21, 2025, 1:17 PM

Introduce Functional Button Component

Closed v10.0.0 enhancement
tobiu
tobiu commented on Jul 21, 2025, 1:11 PM

Summary

This ticket tracks the creation and integration of a new Neo.functional.button.Base component. This component will serve as a key UI element built using the functional component paradigm and will be a reference for future functional component development.

Motivation

The framework is expanding to more robustly support functional components alongside its established class-based ones. A functional button is a fundamental building block for most applications. Adding it will enrich the framework's UI toolkit and provide a clear example of how to build functional components that correctly integrate with the reactive VDOM system.

This implementation leverages the framework's existing automatic VDOM node identifier system, which assigns stable and unique IDs to child nodes within the createVdom method. This allows for efficient and precise VDOM diffing without requiring manual ID management within the component's source, keeping the component logic clean and declarative.

Scope

  1. Create Neo.functional.button.Base

    • Location: src/functional/button/Base.mjs
    • Details: A functional button that supports standard configs like text, iconCls, handler, pressed, and badgeText. Its VDOM is generated entirely within the createVdom method.
  2. Create Test Suite

    • Location: test/siesta/tests/functional/Button.mjs
    • Details: A Siesta test suite to verify the button's initial render and that VDOM deltas are correctly and precisely generated for its sub-nodes (e.g., icon, text) when its configs are changed.
  3. Create Demo

    • Location: examples/functional/button/
    • Details: A simple application to demonstrate the usage and features of the new functional button.

Acceptance Criteria

  • The Neo.functional.button.Base class is implemented and added to the repository.
  • The Siesta test for the functional button passes, demonstrating correct initial rendering and precise delta updates.
  • The example application at examples/functional/button correctly displays and interacts with the functional button.
  • The implementation correctly relies on the framework's automatic VDOM node ID generation.
tobiu assigned to @tobiu on Jul 21, 2025, 1:11 PM
tobiu added the enhancement label on Jul 21, 2025, 1:11 PM
tobiu referenced in commit 5d45b3b - "Introduce Functional Button Component #7087" on Jul 21, 2025, 1:16 PM
tobiu closed this issue on Jul 21, 2025, 1:17 PM