Skip to content

Commit

Permalink
feat(VInfiniteScroll): promote from labs
Browse files Browse the repository at this point in the history
  • Loading branch information
johnleider committed Oct 27, 2023
1 parent 1465cf7 commit 08e1fb9
Show file tree
Hide file tree
Showing 11 changed files with 42 additions and 33 deletions.
5 changes: 1 addition & 4 deletions packages/docs/src/data/nav.json
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@
"textareas",
{ "divider": true },
{ "subheader": "data-and-display" },
"infinite-scroller",
"tables",
"virtual-scroller",
{ "divider": true },
Expand Down Expand Up @@ -227,10 +228,6 @@
"title": "date-pickers",
"subfolder": "components"
},
{
"title": "infinite-scroller",
"subfolder": "components"
},
{
"title": "otp-input",
"subfolder": "components"
Expand Down
2 changes: 1 addition & 1 deletion packages/docs/src/pages/en/components/all.md
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,7 @@ These components are used to display data and information in a variety of ways.

</components-list-item>

<components-list-item name="Infinite scroll component" src="infinite-scroller" labs>
<components-list-item name="Infinite scroll component" src="infinite-scroller">

The Infinite scroll component is a container that loads more items when scrolling

Expand Down
64 changes: 39 additions & 25 deletions packages/docs/src/pages/en/components/infinite-scroller.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
---
emphasized: true
meta:
nav: Infinite scrollers
title: Infinite scroller component
Expand All @@ -9,26 +10,22 @@ related:
- /components/data-tables/basics/
- /components/data-iterators/
features:
github: /labs/VInfiniteScroll/
github: /components/VInfiniteScroll/
label: 'C: VInfiniteScroll'
report: true
---

# Infinite scroller
# Infinite scrollers

The `v-infinite-scroll` component displays a potentially infinite list, by loading more items of the list when scrolling. It supports either vertical or horizontal scrolling.

![Infinite scroll Entry](https://cdn.vuetifyjs.com/docs/images/components/v-infinite-scroll/v-infinite-scroll-entry.png)

<page-features />

::: success

This component is feature complete and is pending release in [v3.4.0 (Blackguard)](/introduction/roadmap/#v3-4-blackguard)

:::

::: warning

This feature requires [v3.2.0 (Orion)](/getting-started/release-notes/?version=v3.2.0)
This feature was introduced in [v3.4.0 (Orion)](/getting-started/release-notes/?version=v3.4.0)

:::

Expand All @@ -52,30 +49,33 @@ A **load** event will be emitted when the component needs to load more content.

<entry />

## Installation

Labs components require a manual import and installation of the component.

```js { resource="src/plugins/vuetify.js" }
import { VInfiniteScroll } from 'vuetify/labs/VInfiniteScroll'

export default createVuetify({
components: {
VInfiniteScroll,
},
})
```

## API

| Component | Description |
| - | - |
| [v-infinite-scroll](/api/v-infinite-scroll/) | Primary Component |

## Examples
<api-inline hide-links />

## Anatomy

The `v-infinite-scroll` works with any content in its default slot.

![Infinite scroll Anatomy](https://cdn.vuetifyjs.com/docs/images/components/v-infinite-scroll/v-infinite-scroll-anatomy.png)

| Element / Area | Description |
|----------------|-----------------------------------------|
| 1. Container | The infinite scroller content container |
| 2. Loader | The loader content area |

## Guide

The `v-infinite-scroll` component is a container that allows you to react to a user reaching the end of content area. It is useful when you need to display an unknown but large number of items, and you don't want to load them all at once.

### Props

The `v-infinite-scroll` component has a number of props that can be used to customize its behaviour.

#### Mode

The default behaviour of the component is to try to load more content automatically when the scrollbar gets close to the end. However a manual mode is also supported, where the user needs to do some interaction to load the content. By default this a button, but it can be customized with a [slot](#load-more)
Expand Down Expand Up @@ -108,6 +108,18 @@ The default load more button and loading spinner can be colored with the **color

### Slots

The `v-infinite-scroll` component exposes a number of slots that allow you to further customize its behaviour.

![Infinite scroll Slots](https://cdn.vuetifyjs.com/docs/images/components/v-infinite-scroll/v-infinite-scroll-slots.png)

| Element / Area | Description |
| - | - |
| 1. Container | The default slot |
| 2. Load-more | The slot shown when mode is set to `manual` and status is not `loading` |
| 3. Loading | The slot shown when mode is set to `manual` and status is `loading` |
| 4. Empty | The slot shown when status is `empty` |
| 5. Error | The slot shown when status is `error` |

#### Loading

You can customize the loading message with the **loading** slot.
Expand All @@ -132,7 +144,9 @@ The **error** slot is shown if the status `'error'` is returned from the `done`

<example file="v-infinite-scroll/slot-error" />

### Misc
### Examples

The following are a collection of examples that demonstrate more advanced and real world use of the `v-infinite-scroll` component.

#### Virtualized infinite scroller

Expand Down
2 changes: 0 additions & 2 deletions packages/docs/src/pages/en/labs/introduction.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,6 @@ The following is a list of available and up-and-coming components for use with L
| [useDate](/api/use-date/) | The date composable is used by components that require date functionality | |
| **Date picker** | [Usage](/components/date-pickers/) | [v3.3.4&nbsp;(Icarus)](/getting-started/release-notes/?version=v3.3.4) |
| [v-date-picker](/api/v-date-picker/) | Primary Component | |
| **Infinite scroll** | [Usage](/components/infinite-scroller/) | [v3.2.0&nbsp;(Orion)](/getting-started/release-notes/?version=v3.2.0) |
| [v-infinite-scroll](/api/v-infinite-scroll/) | Primary Component | |
| **OTP input** | [Usage](/components/otp-input/) | [v3.3.11&nbsp;(Icarus)](/getting-started/release-notes/?version=v3.3.11) |
| [v-otp-input](/api/v-otp-input/) | Primary Component | |

Expand Down
1 change: 1 addition & 0 deletions packages/vuetify/src/components/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ export * from './VGrid'
export * from './VHover'
export * from './VIcon'
export * from './VImg'
export * from './VInfiniteScroll'
export * from './VInput'
export * from './VItemGroup'
export * from './VKbd'
Expand Down
1 change: 0 additions & 1 deletion packages/vuetify/src/labs/components.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
export * from './VDataIterator'
export * from './VDataTable'
export * from './VDatePicker'
export * from './VInfiniteScroll'
export * from './VOtpInput'
export * from './VPicker'

0 comments on commit 08e1fb9

Please sign in to comment.