@tectra-ng/ui 0.1.4 → 0.1.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,53 @@
1
+ # Carousel
2
+
3
+ Shows a list of items a few at a time and pages through them with buttons, indicators, swipes or on its own. Horizontal or vertical, with a different number of visible items per screen width.
4
+
5
+ ```html
6
+ <tx-carousel [value]="products" [numVisible]="3" [numScroll]="1" ariaLabel="New arrivals">
7
+ <ng-template txCarouselItem let-product>
8
+ <article class="card">{{ product.name }}</article>
9
+ </ng-template>
10
+ </tx-carousel>
11
+ ```
12
+
13
+ ## Inputs
14
+ | Name | Description |
15
+ |---|---|
16
+ | value | Items to show |
17
+ | page | Index of the current page; two-way with `[(page)]` |
18
+ | numVisible | Number of items shown at once |
19
+ | numScroll | Number of items one step moves |
20
+ | responsiveOptions | `numVisible` and `numScroll` per `breakpoint` (max width of the window), for example `[{ breakpoint: '768px', numVisible: 1 }]` |
21
+ | orientation | `horizontal` or `vertical` |
22
+ | verticalViewPortHeight | Height of the visible area in vertical orientation |
23
+ | circular | The last page goes on to the first and back |
24
+ | autoplayInterval | Milliseconds between automatic steps; `0` turns autoplay off. Autoplay pauses on hover and focus and stops after a manual step |
25
+ | showIndicators | Shows the page indicators |
26
+ | showNavigators | Shows the previous and next buttons |
27
+ | swipe | Pages with a swipe or a mouse drag |
28
+ | effect | How a page replaces the previous one: `slide` (default) moves the strip; `fade`, `zoom`, `blur` and `flip` let the visible items leave and the next ones arrive; `none` jumps |
29
+ | prevIcon | Icon of the previous button; a chevron that follows the orientation by default |
30
+ | nextIcon | Icon of the next button |
31
+ | ariaLabel | Accessible name of the carousel |
32
+ | ariaLabelledBy | Id of the element that names the carousel |
33
+ | dt | Design tokens of this instance (`carousel`) |
34
+ | pt | Classes and styles of the parts: `root`, `header`, `content`, `viewport`, `track`, `item`, `navigator`, `indicators`, `indicator`, `footer` |
35
+ | ptOptions | How `pt` merges with the global pass-through |
36
+ | unstyled | Removes the tectra styles |
37
+
38
+ ## Slots
39
+ | Name | Description |
40
+ |---|---|
41
+ | txCarouselItem | `<ng-template txCarouselItem let-item let-index="index" let-active="active">` — one item; `active` is true while it is visible |
42
+ | txCarouselIndicator | `<ng-template txCarouselIndicator let-page let-active="active">` — content of a page indicator |
43
+ | txCarouselHeader | Content above the carousel |
44
+ | txCarouselFooter | Content below the carousel |
45
+
46
+ ## Keyboard
47
+ | Key | Action |
48
+ |---|---|
49
+ | Tab / Shift + Tab | Moves between the previous button, the visible items, the next button and the current indicator |
50
+ | Enter / Space | On a button: moves to the previous or next page, or to the page of the indicator |
51
+ | Arrow right / Arrow down | On an indicator: shows the next page |
52
+ | Arrow left / Arrow up | On an indicator: shows the previous page |
53
+ | Home / End | On an indicator: shows the first or the last page |