Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/fouita/svelte-tw-pagination

Svelte + tailwindcss pagination component
https://github.com/fouita/svelte-tw-pagination

fouita svelte tailwindcss

Last synced: 3 months ago
JSON representation

Svelte + tailwindcss pagination component

Awesome Lists containing this project

README

        

# Responsive Svelte + Tailwind Pagination component

Simple pagination component built with svelte and tailwindcss

## Installation
```bash
$npm i @fouita/pagination -D
```

## Simple usage

![fouita pagination](https://cdn.fouita.com/assets/pics/template/pagination/pagination-simple.png)

```html

import Pagination from '@fouita/pagination'
let current =1
let num_items=30
let per_page=3

```

## Style rounded

![fouita pagination rounded](https://cdn.fouita.com/assets/pics/template/pagination/pagination-rounded.png)

```html

```

## Change Size to small

![fouita pagination small](https://cdn.fouita.com/assets/pics/template/pagination/pagination-small.png)

```html

```

## Change Color

You can use a color from tailwindcss list `(gray, red, blue, indigo, pink, purple, teal, orange, yellow)`

![fouita pagination small](https://cdn.fouita.com/assets/pics/template/pagination/pagination-color.png)

```html

```

## Per page selection

You can add

![fouita pagination selection](https://cdn.fouita.com/assets/pics/template/pagination/pagination_per_page.png)

```html

import Pagination from '@fouita/pagination'

let current =1
let num_items=30
let per_page=3




Per page:

3
5
10




```

## Navigate Action

if you like to perform some actions or API requests when navigating through pages, you can do so by calling `on:navigate` event.

```html

import Pagination from '@fouita/pagination'

let current =1
let num_items=30
let per_page=3

// let list_fetch = ... your init data
async function changePage(evt){
current = evt.detail
// list_fetched = ... FETCH DATA HERE
}

```

## About

[Fouita : UI framework for svelte + tailwind components](https://fouita.com)