v2.1.8
/
  • Get Started
  • Components
  • Composables
  • Typography
  • GitHub
  • Layout
  • App
  • Container
  • Error
  • SidebarLayout
  • Element
  • Advice
  • Alert
  • Avatar
  • AvatarGroup
  • Badge
  • Banner
  • Button
  • Calendar
  • Card
  • Chip
  • Collapsible
  • Countdown
  • FieldGroup
  • Kbd
  • Progress
  • Separator
  • Skeleton
  • Form
  • Checkbox
  • CheckboxGroup
  • ColorPicker
  • FileUpload
  • Form
  • FormField
  • Input
  • InputDate
  • InputMenu
  • InputNumber
  • InputTags
  • InputTime
  • PinInput
  • RadioGroup
  • Range
  • Select
  • SelectMenu
  • Switch
  • Textarea
  • Data
  • Accordion
  • DescriptionList
  • Empty
  • Table
  • TableWrapper
  • Timeline
  • User
  • Navigation
  • Breadcrumb
  • CommandPalette
  • Link
  • NavigationMenu
  • Pagination
  • Stepper
  • Tabs
  • Overlay
  • ContextMenu
  • DropdownMenu
  • Modal
  • Popover
  • Slideover
  • Toast
  • Tooltip
  • Page
  • PageCard
  • PageColumns
  • PageGrid
  • PageLinks
  • PageList
  • Dashboard
  • DashboardGroup
  • DashboardSearch
  • DashboardSearchButton
  • AI Chat
  • soonChatMessage
  • soonChatMessages
  • soonChatPalette
  • soonChatPrompt
  • soonChatPromptSubmit
  • Content
  • ContentSearch
  • ContentSearchButton
  • ContentSurround
  • ContentToc
  • Color Mode
  • ColorModeAvatar
  • ColorModeButton
  • ColorModeImage
  • ColorModeSelect
  • ColorModeSwitch
  • i18n
  • LocaleSelect
  • b24icons
  • b24jssdk
Use our Nuxt starter
v2.1.8
  • Docs
  • Components
  • Composables
  • Typography

Pagination

A navigation component with buttons or links for pagination.
GitHub
Demo
Nuxt UI
PaginationPagination

Usage

Use the default-page prop or the v-model:page directive to control the current page.

{
  "wait": "Loading client-side content..."
}
The Pagination component uses some Button to display the pages, use color and size props to style them.

Total

Use the total prop to set the total number of items in the list.

{
  "wait": "Loading client-side content..."
}

Items Per Page

Use the items-per-page prop to set the number of items per page. Defaults to 10.

{
  "wait": "Loading client-side content..."
}

Sibling Count

Use the sibling-count prop to set the number of siblings to show. Defaults to 2.

{
  "wait": "Loading client-side content..."
}

Show Edges

Use the show-edges prop to always show the ellipsis, first and last pages. Defaults to false.

{
  "wait": "Loading client-side content..."
}

Show Controls

Use the show-controls prop to show the first, prev, next and last buttons. Defaults to true.

{
  "wait": "Loading client-side content..."
}

Color

Use the color prop to set the color of the inactive controls. Defaults to air-secondary-no-accent.

{
  "wait": "Loading client-side content..."
}

Active Color

Use the active-color prop to set the color of the active control. Defaults to air-primary.

{
  "wait": "Loading client-side content..."
}

Size

Use the size prop to set the size of the controls. Defaults to md.

{
  "wait": "Loading client-side content..."
}

Disabled

Use the disabled prop to disable the pagination controls.

{
  "wait": "Loading client-side content..."
}

Examples

With links

Use the to prop to transform buttons into links. Pass a function that receives the page number and returns a route destination.

1
4
5
6
10
{
  "wait": "Loading client-side content..."
}
In this example we're adding the #with-links hash to avoid going to the top of the page.

API

Props

Prop Default Type
as'div'any

The element or component this component should render as.

firstIconicons.chevronDoubleLeftIconComponent

The icon to use for the first page control.

prevIconicons.chevronLeftIconComponent

The icon to use for the previous page control.

nextIconicons.chevronRightIconComponent

The icon to use for the next page control.

lastIconicons.chevronDoubleRightIconComponent

The icon to use for the last page control.

ellipsisIconicons.ellipsisIconComponent

The icon to use for the ellipsis control.

color'air-secondary-no-accent'"air-primary" | "air-primary-success" | "air-primary-alert" | "air-primary-copilot" | "air-secondary" | "air-secondary-alert" | "air-secondary-accent" | "air-secondary-accent-1" | "air-secondary-accent-2" | "air-secondary-no-accent" | "air-tertiary" | "air-tertiary-accent" | "air-tertiary-no-accent" | "air-selection" | "air-boost" | "link"

The color of the pagination controls.

activeColor'air-primary'"air-primary" | "air-primary-success" | "air-primary-alert" | "air-primary-copilot" | "air-secondary" | "air-secondary-alert" | "air-secondary-accent" | "air-secondary-accent-1" | "air-secondary-accent-2" | "air-secondary-no-accent" | "air-tertiary" | "air-tertiary-accent" | "air-tertiary-no-accent" | "air-selection" | "air-boost" | "link"

The color of the active pagination control.

showControlstrueboolean

Whether to show the first, previous, next, and last controls.

size "xs" | "md" | "xss" | "sm" | "lg" | "xl"
to (page: number): string | RouteLocationAsRelativeGeneric | RouteLocationAsPathGeneric

A function to render page controls as links.

defaultPage number

The value of the page that should be active when initially rendered.

Use when you do not need to control the value state.

disabledboolean

When true, prevents the user from interacting with item

itemsPerPage10 number

Number of items per page

page number

The controlled value of the current page. Can be binded as v-model:page.

showEdgesfalseboolean

When true, always show first page, last page, and ellipsis

siblingCount2 number

Number of sibling should be shown around the current page

total0 number

Number of items in your list

b24ui { root?: ClassNameValue; list?: ClassNameValue; ellipsis?: ClassNameValue; label?: ClassNameValue; first?: ClassNameValue; prev?: ClassNameValue; item?: ClassNameValue; next?: ClassNameValue; last?: ClassNameValue; }

Slots

Slot Type
first{}
prev{}
next{}
last{}
ellipsis{ b24ui: object; }
item{ page: number; pageCount: number; item: { type: "ellipsis"; } | { type: "page"; value: number; }; index: number; }

Emits

Event Type
update:page[value: number]

Theme

app.config.ts
export default defineAppConfig({
  b24ui: {
    pagination: {
      slots: {
        root: '',
        list: 'flex items-center gap-1',
        ellipsis: 'pointer-events-none',
        label: 'text-center',
        first: '',
        prev: '',
        item: '',
        next: '',
        last: ''
      }
    }
  }
})
vite.config.ts
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import bitrix24UIPluginVite from '@bitrix24/b24ui-nuxt/vite'

export default defineConfig({
  plugins: [
    vue(),
    bitrix24UIPluginVite({
      b24ui: {
        pagination: {
          slots: {
            root: '',
            list: 'flex items-center gap-1',
            ellipsis: 'pointer-events-none',
            label: 'text-center',
            first: '',
            prev: '',
            item: '',
            next: '',
            last: ''
          }
        }
      }
    })
  ]
})

NavigationMenu

A link list that can be arranged in horizontal or vertical orientation.

Stepper

A stepper component to visualize progress in a multistep workflow.

On this page

  • Usage
    • Total
    • Items Per Page
    • Sibling Count
    • Show Edges
    • Show Controls
    • Color
    • Active Color
    • Size
    • Disabled
  • Examples
    • With links
  • API
    • Props
    • Slots
    • Emits
  • Theme
Releases
Published under MIT License.

Copyright © 2024-present Bitrix24