primefaces / primeng

The Most Complete Angular UI Component Library
https://primeng.org
Other
10.46k stars 4.6k forks source link

Sidebar: custom or predefined close button position #13741

Open akhalaiav opened 1 year ago

akhalaiav commented 1 year ago

Describe the feature you would like to see added

In existing functionality, we can only show or hide the close button.

Documentation https://primeng.org/sidebar#api.sidebar .

show:

Снимок экрана 2023-09-25 в 17 33 37

hide:

Снимок экрана 2023-09-25 в 17 33 22

but in my case, I would like to have the custom close button outside of the sidebar.

like :

Снимок экрана 2023-09-25 в 17 33 22 — копия

or

Снимок экрана 2023-09-26 в 09 44 13

Is it possible to implement this functionality?

Is your feature request related to a problem?

No response

Describe the solution you'd like

Will be better when we have something like that:

<p-sidebar closeButtonPosition="outside">
    ...
</p-sidebar>

Describe alternatives you have considered

We can hide the close button and create some manual close button with styles, but I think it is not a good idea.

Additional context

Current: PrimeNg Version - 16.3.1 Node 18

Environment Latest Angular and Primeng version

akhalaiav commented 8 months ago

it can be implemented like

<p-sidebar>
      <p-button
          (onClick)="onHide()"
          [outlined]="true"
          [rounded]="true"
          [style]="{top: '20px', left: '20%' }"
          ariaLabel="Outlined Close Button"
          class="hidden md:block"
          icon="pi pi-times font-bold"
          styleClass="fixed text-white border-2 focus:shadow-none font-normal"
      ></p-button>
</p-sidebar>