Skip to content

feat: shared React component library for Headlamp plugin authors #5928

@Athang69

Description

@Athang69

Is your feature request related to a problem? Please describe the impact that the lack of the feature requested is creating.

Every Headlamp plugin that surfaces Kubernetes custom resources faces the same set of UI problems: rendering .status.conditions[] arrays, building consistent detail page layouts, displaying phase strings as colored chips, and handling loading, error, and empty states. Right now each plugin author solves these independently, which means duplicated code, inconsistent UX across plugins, and a steeper learning curve for new contributors who have to reverse-engineer patterns from existing plugins instead of reaching for a documented, tested component.

With multiple plugins either recently merged or actively in development (Agones, Argo CD, Kueue, Metal3, Tinkerbell, Cluster API, Kubeflow, Strimzi, Knative), this duplication is becoming a real cost. There is no shared foundation that plugin authors can build on.

Describe the solution you'd like

A shared component library scoped specifically to Headlamp plugin development, either living under frontend/src/plugin-components in the main repo or published as a standalone package under the @headlamp-k8s namespace.

The initial set of components I am proposing, based on patterns I have seen repeated across the existing plugin PRs:

  • <CRDStatusBadge /> - renders a Kubernetes .status.conditions[] array with type, status, and reason surfaced consistently
  • <ResourceDetailLayout /> - a standard scaffold for custom resource detail pages with metadata, status, and events sections
  • <CRDTable /> - a table component wired for custom resources with sorting, filtering, and pagination
  • <ConditionList /> - renders condition arrays with icons and color coding tied to condition status
  • <PhaseChip /> - maps any .status.phase string to a MUI chip with sensible color defaults for common Kubernetes phase values

Each component would ship with:

  • Full TypeScript types
  • Unit tests
  • Storybook stories for visual reference and manual testing
  • JSDoc on all props

What users will benefit from this feature?

Plugin developers primarily. Anyone building a Headlamp plugin that surfaces custom resources would have a set of tested, documented building blocks instead of building from scratch. This also benefits end users indirectly because consistent components mean a consistent UX across all plugins, so switching between the Agones plugin and the Argo CD plugin does not feel like a different product.

Are you able to implement this feature?

Yes (I will propose a PR).

Before opening a PR I wanted to raise this here first to get maintainer input on two things:

  1. Whether this belongs in the main repo or as a separate package under @headlamp-k8s
  2. Whether there are existing internal patterns or component abstractions I should align with before starting

Happy to jump on the Slack channel to discuss further if that is easier.

Additional context

I have hands-on experience with the kubernetes-sigs/headlamp codebase across multiple layers and this proposal comes directly from noticing the same patterns being re-implemented across plugin PRs.

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/featureCategorizes issue or PR as related to a new feature.

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions