Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
ng-mat-carousel
Advanced tools
Readme
This is a carousel component for Angular using Material Design. See live demo.
This is a fork and prolongation of the discontinued @ngmodule/material-carousel
by Gabriel Sanches.
The current development goal is to keep the package secure and compatible with the most recent Angular version.
PR's are welcomed; including bugfixes, upgrades and enhancements.
npm install --save ng-mat-carousel
//...
import { MatCarouselModule } from 'ng-mat-carousel';
@NgModule({
// ...
imports: [
// ...
MatCarouselModule.forRoot(),
// ...
]
})
export class AppModule {}
MatCarouselComponent
import { MatCarousel, MatCarouselComponent } from 'ng-mat-carousel';
<mat-carousel>
...
</mat-carousel>
Input | Type | Description | Default value |
---|---|---|---|
timings | string | Timings for slide animation. | '250ms ease-in' |
autoplay | boolean | Enable automatic sliding. | true |
interval | number | Autoplay's interval in milliseconds. | 5000 |
loop | boolean | Enable loop through arrows. | true |
hideArrows | boolean | Hide navigation arrows. | false |
hideIndicators | boolean | Hide navigation indicators. | false |
color | ThemePalette | Color palette from Material. | 'accent' |
maxWidth | string | Maximum width. | 'auto' |
maintainAspectRatio | boolean | If true, use proportion to determine height, else slideHeight is used. | true |
proportion | number | Height proportion compared to width. | 25 |
slideHeight | string | Explicit slide height. Used when maintainAspectRatio is false. | '100%' |
slides | number | Maximum amount of displayed slides. | |
useKeyboard | boolean | Enable keyboard navigation. | true |
useMouseWheel | boolean | Enable navigation through mouse wheeling. | false |
orientation | Orientation | Orientation of the sliding panel. | 'ltr' |
svgIconOverrides | SvgIconOverrides | Override default carousel icons with registered SVG icons. | |
ariaLabel | string | Carousel accessible name | 'Sliding carousel' |
lazyLoad | booelan | Lazy load content | false |
By default, maintainAspectRatio
is true, which means height is controlled through proportion
.
If you want to have a carousel with constant height (regardless of width), you must set maintainAspectRatio
to false.
By default, slideHeight
is set to 100%
, which will not work if the parent element height isn't defined (i.e. relative heights do not work if the parent height is auto
). In that case you could pass a valid css string for slideHeight
. You can use any valid css height string like 100px
or 25vh
.
Play around with the demo to see how you can use this carousel with or without explicit parent height.
With parent elements that have height:auto
proportion
if you want a carousel that resizes responsively (this is the default configuration).maintainAspectRatio="false"
and a non-percentage slideHeight
if you want a fixed height carousel.slideHeight
; the carousel will not render.With parent elements that have a set height
maintainAspectRatio="false"
if you want a fixed height carousel that fills the parent element (slideHeight
is 100%
by default).maintainAspectRatio="false"
and slideHeight
(unless slideHeight="100%"
); the carousel will not render correctly because the buttons and indicators will be positioned with respect to the parent.proportion
; this will lead to gaps or unwanted overflow.MatCarouselSlideComponent
import { MatCarouselSlide, MatCarouselSlideComponent } from '@ngmodule/material-carousel';
<mat-carousel>
<mat-carousel-slide>
...
</mat-carousel-slide>
</mat-carousel>
Input | Type | Description | Default value |
---|---|---|---|
image | string | Image displayed in the slide. | |
overlayColor | string | Color of the slide's overlay. | '#00000040' |
hideOverlay | boolean | Toggle overlay on/off. | false |
ariaLabel | string | Image accessible name | 'Slide' |
load | boolean | Override lazyLoad | true |
ng test carousel --watch false
ng serve demo
FAQs
Carousel component for Angular using Material Design.
The npm package ng-mat-carousel receives a total of 1,682 weekly downloads. As such, ng-mat-carousel popularity was classified as popular.
We found that ng-mat-carousel demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.