Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Metadata API #798

Open
chrisvxd opened this issue Jan 14, 2025 · 0 comments
Open

Metadata API #798

chrisvxd opened this issue Jan 14, 2025 · 0 comments

Comments

@chrisvxd
Copy link
Member

Add a metadata API to enable the user to inject their own data down the Puck tree. This can provide a viable alternative to state management solutions, and should work for server components.

Proposal

Add a metadata prop to the Puck component:

<Puck metadata={{ foo: "bar" }} />

Pass into components via the `puck.metadata prop:

{
  render: ({ puck }) => <div>{puck.metadata.foo}</div>
}

Considerations

  • Consider generic typing of metadata, especially when user is using Config or ComponentConfig types
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant