Next.js Discord

Discord Forum

Popover With Form example: Where does 'titleProps' come from

Answered
American black bear posted this in #help-forum
Open in Discord
American black bearOP
From the documentation, in the popover component "with form" code example (https://nextui.org/docs/components/popover#with-form), in the snippet below:
<PopoverContent className="w-[240px]">
  {(titleProps) => (
    <div className="px-1 py-2 w-full">
      <p className="text-small font-bold text-foreground" {...titleProps}>
        Dimensions
      </p>
      <div className="mt-2 flex flex-col gap-2 w-full">
        <Input defaultValue="100%" label="Width" size="sm" variant="bordered" />
        <Input defaultValue="300px" label="Max. width" size="sm" variant="bordered" />
        <Input defaultValue="24px" label="Height" size="sm" variant="bordered" />
        <Input defaultValue="30px" label="Max. height" size="sm" variant="bordered" />
      </div>
    </div>
  )}
</PopoverContent>

What does the titlePropscome from? I have seen a few other examples with similar usage such as the onClosein the Modal component. Can anyone example?
Answered by Barbary Lion
I think this will help, here it states what it's purpose is! https://nextui.org/docs/components/popover#title-props
View full answer

4 Replies

Barbary Lion
I think this will help, here it states what it's purpose is! https://nextui.org/docs/components/popover#title-props
Answer
American black bearOP
Somehow I missed that in the docs, thanks @Barbary Lion
American black bearOP
lmao, I just noticed i posted in nextjs channel rather than nextui's 🤦‍♂️ :lolsob: