Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dynamic Dialog: Possibility to style header #13890

Closed
pistage opened this issue Oct 16, 2023 · 2 comments
Closed

Dynamic Dialog: Possibility to style header #13890

pistage opened this issue Oct 16, 2023 · 2 comments
Labels
Status: Discussion Issue or pull request needs to be discussed by Core Team Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible Type: New Feature Issue contains a new feature or new component request

Comments

@pistage
Copy link
Contributor

pistage commented Oct 16, 2023

Describe the feature you would like to see added

I would like to request the addition of a feature that allows users to style the background and other visual elements of the header within the dynamic dialog. Currently, there's limited flexibility in customizing the header's appearance, and I believe this enhancement will greatly improve the user experience.

Is your feature request related to a problem?

Yes, it is. When using dynamic dialogs, I often find myself limited in terms of header customization.

Describe the solution you'd like

I propose enabling users to have more control over the styling of the header within the dynamic dialog. This should include the ability to:

  • Customize the background color or image of the header.
  • Adjust the font, text color, and alignment of the header title or content.
  • Apply CSS styles or themes to the header for a consistent look and feel with the rest of the application.

Describe alternatives you have considered

I have explored alternative solutions, such as creating custom dialog components, but these approaches often involve significant development effort and can lead to code duplication. Having built-in support for customizable header styling would simplify the process and improve code maintainability.

Additional context

No response

@pistage pistage added Status: Discussion Issue or pull request needs to be discussed by Core Team Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible Type: New Feature Issue contains a new feature or new component request labels Oct 16, 2023
@bvx5009
Copy link

bvx5009 commented Jan 25, 2024

i was able to customize a dynamic dialog by passing a class and editing the dialog css for that nested class


    this.ref = this.dialogService.open(MyComponent, 
      { 
          ...
        styleClass: 'my-class-here'
         ...
      }

sass:


.my-class-here  {
    .p-dialog-header {
        border-bottom: 1px solid var(--surface-border);
    }
    .p-dialog-content {
  //something here
    }
    .p-dialog-header, .p-dialog-content, .p-dialog-footer {
        background-color: var(--surface-b);
    }
}

i've used variables for consistent themes across the app as well.

However, i think it would be beneficial to have a custom header template with dynamic dialogs... insert custom avatars, buttons, dropdowns etc.

EDIT:

after more searching i found that you can specify templates which would allow you to do what you want:

this.ref = this.dialogService.open(MyComponent, 
      { 
        styleClass: 'review-comment-dialog',
        templates: {
          header: MyHeaderComponent
        }
      }

@mehmetcetin01140
Copy link
Contributor

Hi,

So sorry for the delayed response! Improvements have been made to many components recently, both in terms of performance and enhancement. Therefore, this improvement may have been developed in another issue ticket without realizing it. You can check this in the documentation. If there is no improvement on this, can you open a new issue so we can include it in our roadmap?

Thanks a lot for your understanding!
Best Regards,

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Discussion Issue or pull request needs to be discussed by Core Team Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible Type: New Feature Issue contains a new feature or new component request
Projects
None yet
Development

No branches or pull requests

3 participants