Skip to content

@hashintel/refractive Feature Request: Add framework-agnostic support (Vanilla HTML/CSS, SSR, and Astro) #8828

Description

@Stephcraft

To increase the versatility and adoption of @hashintel/refractive, I would like to request support for non-SPA environments. Currently, the library is optimized for client-side frameworks, but providing compatibility for static site generation, Server-Side Rendering (SSR), and integration with frameworks like Astro would significantly broaden the use cases.

Goals:

  • Vanilla HTML/CSS Support: Provide a way to utilize Refractive’s design patterns or components without a heavy framework dependency.
  • SSR Compatibility: Ensure that components can be rendered on the server without errors (handling window or document dependencies gracefully).
  • Astro Integration: Provide a path for seamless integration within Astro projects (e.g., via Web Components or Astro Islands).

Proposed Implementation Considerations:

  • Web Components (Custom Elements): Creating framework-agnostic components as standard Web Components would allow them to be consumed by Vanilla HTML, Astro, and SSR environments natively.
  • SSR Hooks: Ensure proper handling of hydration if/when components are used in islands or server-rendered pages.

Impact:
This will allow developers to use Refractive in content-heavy sites, landing pages, and projects that prefer the performance benefits of Astro or static HTML without sacrificing the UI/UX consistency provided by the library.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions