fern icon indicating copy to clipboard operation
fern copied to clipboard

Expose nested parameter component

Open dnsbty opened this issue 9 months ago • 0 comments

Which Fern component?

Fern Docs

How important is this?

P3 - Low (Nice to have)

What's the feature?

I would love to be able to nest ParamField components similar to the way they're displayed when I have a nested object in my JSON like this:

Image

When using the ParamField component, it always puts a border at the bottom of each parameter. It would be great if I could specify not to show the border for the last param field being used, similar to what y’all do in your API property card. Even better though would be allowing me to use that component myself, or if it’s already allowed, showing me how to create a nested parameter like that with the ParamField component

Any alternatives?

I'm currently nesting an Accordion with multiple ParamField components inside a top-level ParamField, so with code like this:

<ParamField path="data" type="conversation">
  <Accordion title="properties" defaultOpen>
    <ParamField path="id" type="string">
      The unique identifier for the conversation
    </ParamField>

    <ParamField path="contact" type="contact">
      <Accordion title="properties">
        <ParamField path="id" type="string">
          The unique identifier for the contact
        </ParamField>

        <ParamField path="first_name" type="string">
          The first name of the contact, if it is known
        </ParamField>

        <ParamField path="last_name" type="string">
          The last name of the contact, if it is known
        </ParamField>

        <ParamField path="phone_number" type="string">
          The contact's phone number in E.164 format
        </ParamField>
      </Accordion>
    </ParamField>
  </Accordion>
</ParamField>

The one used for my OpenAPI generated pages is much nicer, and I would love to be able to use that here. At the very least, it would be nice if I could specify that there shouldn't be a bottom border on the last ParamField because it's creating a weird double border:

Image

Are you interested in contributing this feature?

Yes

dnsbty avatar Apr 01 '25 22:04 dnsbty