primevue-tailwind icon indicating copy to clipboard operation
primevue-tailwind copied to clipboard

Method for providing extra props?

Open aDogCalledSpot opened this issue 9 months ago • 0 comments

Is it currently possible or are there plans to support adding extra props to a component that can then be passed on to the passthrough arguments?

Example:

Most of my Panels are only text, so I have some padding for the content:

content: {
  class: 'p-4 sm:p-6'
}

I would like the possibility to also have panels with no margins since that works better for some content.

Ideally I would be able to do something like this:

// MyComponent.vue
<Panel noMargin header="Foo">
  <AnotherComponent />
</Panel>

and then change my preset to the following:

content: {
  class: [
    { 'p-4 sm:p-6': props.noMargin !== true }
  ]
}

aDogCalledSpot avatar Apr 26 '24 11:04 aDogCalledSpot