![Create React App Officially Deprecated Amid React 19 Compatibility Issues](https://cdn.sanity.io/images/cgdhsj6q/production/04fa08cf844d798abc0e1a6391c129363cc7e2ab-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Create React App Officially Deprecated Amid React 19 Compatibility Issues
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
ng-carousel-cdk
Advanced tools
Basic carousel engine on Angular
https://vagrantai-c.github.io/ng-carousel-cdk/
Angular version 7 or higher
npm i ng-carousel-cdk
npm i hammerjs
hammerjs
in main.ts
file:
import 'hammerjs';
Import carousel in module
import { CarouselModule } from 'ng-carousel-cdk';
@NgModule({
imports: [
CarouselModule
],
})
export class AnyModule { }
Apply it in component
Component:
const config: CarouselConfig = {
items: [
{name: 1},
{name: 2},
{name: 3},
],
}
Template:
<ng-carousel [config]="config">
<ng-template ngCarouselSlide let-item>
{{item.name}}
</ng-template>
</ng-carousel>
CarouselComponent
Selector: ng-carousel
Exported as ngCarousel
Use template with ngCarouselSlide
directive applied to declare slide template. Every item provided within carousel config would be injected into it. Example:
<ng-carousel>
<ng-template
ngCarouselSlide
let-item
let-index="itemIndex"
let-isActive="isActive"
let-inViewport="inViewport">
Slide №{{index}} content
</ng-template>
</ng-carousel>
Template is enriched with next context structure:
$implicit
: injected itemitemIndex
: item index of current slideisActive
: whether slide is currently activeinViewport
: whether slide is currently visible (at least 1 pixel is in viewport)config: CarouselConfig
Possible options:
items: any[] = [];
Items to be rendered inside carouseslideWidth = 100;
All slides have same width and this field specifies itwidthMode: CarouselWidthMode = CarouselWidthMode.PERCENT;
How slideWidth
should interpret its value, whether in pixels or percentsalignMode: CarouselAlignMode = CarouselAlignMode.CENTER;
Regulates where active slide should be placeautoplayEnabled = true;
Whether active slide should change over timeautoplayDelay = 6000;
Specifies how often active slide should change. Only applied if autoplayEnabled
is set to truedragEnabled = true;
Whether drag is enabled. Be adviced that drag only available when hammerjs is installedshouldLoop = true;
Whether carousel is allowed to copy slides in order to fill empty spacetransitionDuration = 280;
Animation duration on slide changeshouldRecalculateOnResize = true;
Whether carousel should recalculate upon window resize. Useful when carousel takes full page width or carousel width is relative to viewport width (either in %
or vw
)itemIndexChange
Emits number of item index upon active slide changes
One can export carousel via exportAs
or @ViewChild
syntax.
Template
<ng-carousel #carouselRef="ngCarousel"></ng-carousel>
or
@ViewChild(CarouselComponent) carouselRef: CarouselComponent;
Use this reference to programmaticaly trigger next events:
carouselRef.next()
: increment active slidecarouselRef.prev()
: decrement active slidecarouselRef.setIndex(newIndex: number)
: focus slide with provided item index. When no slides are available, index change would postpone till slide initialization.carouselRef.recalculate()
: recalculate positionsselector: [ngCarouselPreventGhostClick]
Use directive on button, anchor or any clickable element. This will prevent ghost clicks after pan ends.
<ng-carousel>
<button
(click)="processClick($event)"
ngCarouselPreventGhostClick>
...
</button>
</ng-carousel>
When drag starts on button element, it won't be clicked upon drag end.
FAQs
Basic carousel engine on Angular
The npm package ng-carousel-cdk receives a total of 0 weekly downloads. As such, ng-carousel-cdk popularity was classified as not popular.
We found that ng-carousel-cdk 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
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.