Skip to content

Enable deep customization via a new render function prop (DRAFT)#2576

Open
ukqfhf wants to merge 2 commits intogravity-ui:mainfrom
ukqfhf:feat/menuitem-render-prop
Open

Enable deep customization via a new render function prop (DRAFT)#2576
ukqfhf wants to merge 2 commits intogravity-ui:mainfrom
ukqfhf:feat/menuitem-render-prop

Conversation

@ukqfhf
Copy link

@ukqfhf ukqfhf commented Feb 10, 2026

Summary
This PR introduces a new render function prop for MenuItem to enable deep customization while still providing access to internal props via arguments.

Why
The current UI kit is highly opinionated. While this ensures consistency, it limits flexibility. Adding a way to bypass the default rendering—while preserving access to styling and core functionality—improves extensibility.

Modern UI kits (e.g., Base UI) include such render function patterns out of the box, allowing users to fully customize component output without losing built‑in behaviors. See: Base UI Handbook – Composition.

Limitations
Currently, there is no universal renderElement or similar utility. As a result, manually inserting render conditions could increase the risk of errors and reduce maintainability.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant