0.1.4 • Published 10 months ago

pagination-svelte v0.1.4

Weekly downloads
-
License
ISC
Repository
github
Last release
10 months ago

pagination-svelte

GITHUB VERSION NPM VERSION NPM Downloads NPM License Twitter

Pagination is an excellent method for organizing website content into separate pages so users can find the desired page/content. It is a feature we can use on a blog page, a product page, or any other page with a lot of content that we want to distribute across multiple pages.

pagination-svelte is a light weight svelte component that enables the user to select a specific page from a range of pages. The component's formatting was inspired by bootstrap. Really just an inspiration, since the component doesn't rely on bootstrap to work.

PAGINATION

DEMO

REPL: BASIC EXAMPLE

INSTALLATION

npm install pagination-svelte

HOW TO USE IT

<script>
    import Pagination from 'pagination-svelte';
    let page = 1;
</script>

<p>THE SELECTED PAGE IS: {page}</p>

<Pagination
    propNumberOfPages={7}
    bind:propActivePage={page}
    on:eventChange={(parEvent) => console.log(parEvent.detail.numberActivePage)}
/>

PROPS

  • BEHAVIOR PROPS:
PROPTYPEDEFAULTDESCRIPTION
propActivePagenumber1The selected/active page (bind to this prop)
propNumberOfPagesnumber5The total number of pages. If propNumberOfRows is different from undefined, this property will not be used.
propPreviousstringPREVIOUSText of the previous button.
propNextstringNEXTText of the next button.
propSizenormal OR small OR largenormalSize of the component.
  • FORMATING PROPS
PROPTYPEDEFAULTDESCRIPTION
cssActiveBackgroundColorstring (RGB, RGBA, HEX OR COLOR NAME)#0d6efd (blue)Background color of the active page.
cssBackgroundColorstring (RGB, RGBA, HEX OR COLOR NAME)#fff (white)Background color of the inactive pages.
cssHoverBackgroundColorstring (RGB, RGBA, HEX OR COLOR NAME)#f8f9faBackground color (when hover).
cssActiveFontColorstring (RGB, RGBA, HEX OR COLOR NAME)whiteFont color of the active page.
cssFontColorstring (RGB, RGBA, HEX OR COLOR NAME)#f8f9faFont color of the inactive pages.
cssHoverFontColorstring (RGB, RGBA, HEX OR COLOR NAME)#0a58caFont color of the inactive pages (when hover).
cssActiveBorderColorstring (RGB, RGBA, HEX OR COLOR NAME)#0d6efd (blue)Border color of the active page.
cssDisabledColorstring (RGB, RGBA, HEX OR COLOR NAME)rgba(33, 37, 41, 0.75)Font color of disabled buttons.
cssBorderColorstring (RGB, RGBA, HEX OR COLOR NAME)#dee2e6Border color.
cssBorderWidthstring (rem OR px)1pxBorder width.

EVENTS

  • on:eventChange

DEVELOPING

Once you've created a project and installed dependencies with npm install, start a development server:

npm run dev
0.1.4

10 months ago

0.1.3

1 year ago

0.1.2

1 year ago

0.1.1

1 year ago

0.1.0

1 year ago

0.0.9

1 year ago

0.0.8

1 year ago

0.0.7

1 year ago

0.0.6

1 year ago

0.0.5

1 year ago

0.0.4

1 year ago

0.0.3

1 year ago

0.0.2

1 year ago

0.0.1

1 year ago