Can we utilize default form fields in custom react components?

default discord avatar
superwafflepuffs10 months ago

I've built a react component that injects at the top of my dashboard and renders some custom charts.

I want to add some <Select /> filters to filter the chart data by and want to use consistent UI components as the rest of the dashboard. However, the form fields seem to be tightly coupled to their collection implementations.

Is there some way to access the lower level components and populate them manually?

Right now i'm trying this:

import { Select } from 'payload/components/forms';

<Select options={[]} />

Can this component be used outside of collections?

ah, I see!


is the underlying component and works as expected.

    Star on GitHub


    Chat on Discord



    Can't find what you're looking for?

    Get help straight from the Payload team with an Enterprise License.