Skip to content

Using Payload Form Field Components in your custom components #360

Answered by jacobsfletch
ninahorne asked this question in Q&A
Discussion options

You must be logged in to vote

Okay @ninahorne version 0.13.6 deploys these new features into the Text, Textarea, Upload, and Select components.

Your original request was for Select, so here's an example what a custom select component might look like (and here's the config for that field).

It works exactly as you might expect by exposing the onChange and value for you to manage freely. If you want this value to continue saving to the document (as the example illustrates), you can still sync it with context via the useField hook.

Let us know if you have any troubles wiring this in!

Replies: 4 comments 14 replies

Comment options

You must be logged in to vote
4 replies
@ninahorne
Comment options

@DanRibbens
Comment options

@ninahorne
Comment options

@DanRibbens
Comment options

Comment options

You must be logged in to vote
7 replies
@ninahorne
Comment options

@jacobsfletch
Comment options

@jacobsfletch
Comment options

@ninahorne
Comment options

@jacobsfletch
Comment options

Comment options

You must be logged in to vote
3 replies
@ninahorne
Comment options

@ninahorne
Comment options

@jmikrut
Comment options

Answer selected by jacobsfletch
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
4 participants