Security News
PyPI Introduces Digital Attestations to Strengthen Python Package Security
PyPI now supports digital attestations, enhancing security and trust by allowing package maintainers to verify the authenticity of Python packages.
ngx-float-ui
Advanced tools
ngx-float-ui is an angular wrapper for the FloatingUI library (v ^1.5.3).
I'm moving this to the top because it appears that people don't get to reading it in the contribute section. FOR THIS LIBRARY PLEASE USE ISSUES ONLY FOR BUG REPORTING. DON'T OPEN ISSUES SUCH AS "I need upgrade for Angular 1745646456" especially if Angular 1745646456 was released a few days ago. I guarantee that I manage the updates AS SOON AS POSSIBLE. But as you understand this is not a paying job, so you can't get Angular 1745646456 the day it gets released. ISSUES NOT RESPECTING THIS WILL BE DELETED IMMEDIATELY WITHOUT ANY RESPONSE. Thank you.
The goal of this library is to adopt the more promising technology of floating-ui instead of popper.js and make it available in our Angular projects.
node and npm are required to run this package.
$ npm install @floating-ui/dom ngx-float-ui --save
Or
$ yarn add @floating-ui/dom --save
$ yarn add ngx-float-ui --save
NgxFloatUiModule
:import {NgxFloatUiModule} from 'ngx-float-ui';
@NgModule({
// ...
imports: [
// ...
NgxFloatUiModule
]
})
Optionally you can include in your styles.css
/ styles.css
one of the prebuilt themes:
@import node_modules/ngx-float-ui/css/theme-dark.css
@import node_modules/css/theme-white.css
@use ngx-float-ui/scss/theme as floatUiBaseTheme
@use ngx-float-ui/scss/theme-dark as floatUiDarkTheme
@use ngx-float-ui/scss/theme-white floatUiWhiteTheme
or easily create your own theme using the @mixin:
@use "ngx-float-ui/scss/theme" as floatUiBaseTheme;
body {
@include floatUiBaseTheme.ngx-float-ui-theme($background-color, $text-color, $max-width, $z-index);
}
<float-ui-content #popper1Content>
<p class="bold">Popper on bottom</p>
</float-ui-content>
<div [floatUi]="popper1Content"
[showOnStart]="true"
[trigger]="'click'"
hideOnClickOutside
[hideOnScroll]="true"
[placement]="'bottom'">
<p class="bold">Hey!</p>
<p class="thin">Choose where to put your popper!</p>
</div>
<div floatUi="As text"
[trigger]="'hover'"
[placement]="'bottom'"
(onShown)="onShown($event)">
<p class="bold">Pop</p>
<p class="thin">on the bottom</p>
</div>
<div floatUi="{{someTextProperty}}"
[trigger]="'hover'"
[placement]="'bottom'"
[styles]="{'background-color: 'blue''}"
(onShown)="onShown($event)">
<p class="bold">Pop</p>
<p class="thin">on the bottom</p>
</div>
<div floatUi="As text"
[trigger]="'hover'"
[placement]="'bottom'"
[positionFixed]="true"
(onShown)="onShown($event)">
</div>
<div class="example">
<div #popperTargetElement></div>
<div floatUi="As text"
trigger="hover"
placement="bottom"
[target]="popperTargetElement.nativeElement"
(onShown)="onShown($event)">
</div>
<div [floatUi]="tooltipcontent"
trigger="hover"
placement="bottom"
[applyClass]="'popperSpecialStyle'">
<p class="bold">Pop</p>
<p class="thin">on the bottom</p>
</div>
<popper-floatUi #tooltipcontent>
<div>
<p>This is a tooltip with text</p>
<span (click)="tooltipcontent.hide()">Close</span>
</div>
</popper-floatUi>
Attributes map:
Option | Type | Default | Description |
---|---|---|---|
disableAnimation | boolean | false | Disable the default animation on show/hide |
disableStyle | boolean | false | Disable the default styling |
disabled | boolean | false | Disable the popper, ignore all events |
delay | number | 0 | Delay time until popper it shown |
timeout | number | 0 | Set delay before the popper is hidden |
timeoutAfterShow | number | 0 | Set a time on which the popper will be hidden after it is shown |
placement | Placement(string) | auto | The placement to show the popper relative to the reference element |
target | HtmlElement | auto | Specify a different reference element other the the one hosting the directive |
boundaries | string(selector) | undefined | Specify a selector to serve as the boundaries of the element |
showOnStart | boolean | false | Popper default to show |
trigger | Trigger(string) | click | Trigger/Event on which to show/hide the popper |
positionFixed | boolean | false | Set the popper element to use position: fixed |
appendTo | string | undefined | append The popper-floatUi element to a given selector, if multiple will apply to first |
preventOverflow | boolean | undefined | Prevent the popper from being positioned outside the boundary |
hideOnClickOutside | boolean | true | Popper will hide on a click outside |
hideOnScroll | boolean | false | Popper will hide on scroll |
hideOnMouseLeave | boolean | false | Popper will hide on mouse leave |
applyClass | string | undefined | list of comma separated class to apply on ngpx__container |
styles | Object | undefined | Apply the styles object, aligned with ngStyles |
applyArrowClass | string | undefined | list of comma separated class to apply on ngpx__arrow |
onShown | EventEmitter<> | $event | Event handler when popper is shown |
onHidden | EventEmitter<> | $event | Event handler when popper is hidden |
onUpdate | EventEmitter<> | $event | Event handler when popper is updated |
ariaDescribeBy | string | undefined | Define value for aria-describeby attribute |
ariaRole | string | popper | Define value for aria-role attribute |
Override defaults:
ngx-float-ui comes with a few default properties you can override in default to effect all instances These are overridden by any child attributes.
NgModule({
imports: [
BrowserModule,
FormsModule,
NgxFloatUiModule.forRoot({placement: NgxFloatUiPlacements.TOP})],
declarations: [AppComponent],
providers: [],
bootstrap: [AppComponent]
});
Options | Type | Default |
---|---|---|
showDelay | number | 0 |
disableAnimation | boolean | false |
disableDefaultStyling | boolean | false |
placement | Placement(string) | auto |
boundariesElement | string(selector) | undefined |
trigger | Trigger(string) | hover |
positionFixed | boolean | false |
hideOnClickOutside | boolean | true |
hideOnMouseLeave | boolean | false |
hideOnScroll | boolean | false |
applyClass | string | undefined |
styles | Object | undefined |
applyArrowClass | string | undefined |
ariaDescribeBy | string | undefined |
ariaRole | string | undefined |
appendTo | string | undefined |
preventOverflow | boolean | undefined |
| 'top' | 'bottom' | 'left' | 'right' | 'top-start' | 'bottom-start' | 'left-start' | 'right-start' | 'top-end' | 'bottom-end' | 'left-end' | 'right-end' | 'auto' | 'auto-start' | 'auto-end'
| 'click' | 'mousedown' | 'hover' | 'none'
You can only report bugs. Every other issue will be deleted right away.
$ npm install
$ npm run start //run example
Jetbrains is now supporting this library with an open-source license, which will allow a better code! 🎉
This project is licensed under the MIT License - see the LICENSE file for details
The developers of Floating UI
FAQs
ngx-float-ui is an Angular wrapper for Floating UI
The npm package ngx-float-ui receives a total of 10,377 weekly downloads. As such, ngx-float-ui popularity was classified as popular.
We found that ngx-float-ui demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
PyPI now supports digital attestations, enhancing security and trust by allowing package maintainers to verify the authenticity of Python packages.
Security News
GitHub removed 27 malicious pull requests attempting to inject harmful code across multiple open source repositories, in another round of low-effort attacks.
Security News
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.