You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi team! I propose adding a configuration option (e.g., pure: true) to the createStyleContext helper to allow bypassing the panda() factory and returning standard functional components instead of styled components.
Problem Statement/Justification
I've been using the createStyleContext helper pattern to bridge recipes with Ark components. Currently, the helper creates components using the panda() factory function:
constStyledComponent=panda(Component,{},options)
While this works great for many use cases, it enforces the Styled Component pattern, which introduces a few frictions for strict design systems:
DOM/DevTools Clutter: It wraps pure Ark components in styled wrappers, making the component tree noisier in React DevTools.
Strictness Limitations: In a strict design system, I want to prevent arbitrary style props (like bg="red") on my components. Even with jsxStyleProps: 'none', wrapping components in panda() inherently ties them to the styling engine's runtime prop logic.
Type Complexity: When dealing with Polymorphism (as prop) and generics, the current implementation requires complex type gymnastics to satisfy TypeScript, leading to any casting or cumbersome overrides.
Proposed Solution or API
I propose adding a configuration option to createStyleContext (e.g., pure: true or useStyled: false) that bypasses the panda() factory entirely.
Instead of returning a styled component, it would return a standard functional component that:
Resolves the recipe variants.
Generates the class string.
Passes the class via className (using cx) to the underlying component.
I have manually refactored createStyleContext locally to remove the panda() factory dependencies and use raw className merging. While this works, it diverges from the "standard" helper provided in the docs/snippets, making updates harder.
Additional Information
This change would align perfectly with a "Headless" + "Utility-first" philosophy, giving developers full control over the DOM and reducing the abstraction layer for those who prefer a cleaner component tree.
This discussion was converted from issue #3428 on November 25, 2025 17:05.
Heading
Bold
Italic
Quote
Code
Link
Numbered list
Unordered list
Task list
Attach files
Mention
Reference
Menu
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Description
Hi team! I propose adding a configuration option (e.g.,
pure: true) to thecreateStyleContexthelper to allow bypassing thepanda()factory and returning standard functional components instead of styled components.Problem Statement/Justification
I've been using the
createStyleContexthelper pattern to bridge recipes with Ark components. Currently, the helper creates components using thepanda()factory function:While this works great for many use cases, it enforces the Styled Component pattern, which introduces a few frictions for strict design systems:
DOM/DevTools Clutter: It wraps pure Ark components in
styledwrappers, making the component tree noisier in React DevTools.Strictness Limitations: In a strict design system, I want to prevent arbitrary style props (like
bg="red") on my components. Even withjsxStyleProps: 'none', wrapping components inpanda()inherently ties them to the styling engine's runtime prop logic.Type Complexity: When dealing with Polymorphism (
asprop) and generics, the current implementation requires complex type gymnastics to satisfy TypeScript, leading toanycasting or cumbersome overrides.Proposed Solution or API
I propose adding a configuration option to
createStyleContext(e.g.,pure: trueoruseStyled: false) that bypasses thepanda()factory entirely.Instead of returning a
styledcomponent, it would return a standard functional component that:className(usingcx) to the underlying component.Proposed API Idea:
Alternatives
I have manually refactored
createStyleContextlocally to remove thepanda()factory dependencies and use rawclassNamemerging. While this works, it diverges from the "standard" helper provided in the docs/snippets, making updates harder.Additional Information
This change would align perfectly with a "Headless" + "Utility-first" philosophy, giving developers full control over the DOM and reducing the abstraction layer for those who prefer a cleaner component tree.
Thanks!
All reactions