New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@fouita/pagination

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@fouita/pagination

Simple pagination component built with svelte and tailwindcss

  • 0.0.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

Responsive Svelte + Tailwind Pagination component

Simple pagination component built with svelte and tailwindcss

Installation

    $npm i @fouita/pagination -D

Simple usage

fouita pagination

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

<Pagination bind:current={current} {num_items} {per_page} />

Style rounded

fouita pagination rounded

<Pagination rounded bind:current={current} {num_items} {per_page} />

Change Size to small

fouita pagination small

<Pagination small rounded bind:current={current} {num_items} {per_page} />

Change Color

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

fouita pagination small

<Pagination small rounded color="pink" bind:current={current} {num_items} {per_page} />

Per page selection

You can add

fouita pagination selection

<script>
	import Pagination from '@fouita/pagination'

	let current =1
	let num_items=30
	let per_page=3	
</script>
	
<div class="flex justify-between items-center">
	<div class="flex items-center">
		Per page:
		<select class="border px-2 rounded ml-2" bind:value={per_page}>
			<option>3</option>
			<option>5</option>
			<option>10</option>
		</select>
	</div>
	<Pagination small  bind:current={current} {num_items} per_page={per_page} />
</div>			  

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.

<script>
	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
	}
</script>

<Pagination small {current} {num_items} per_page={per_page} on:navigate={changePage} />

About

Fouita : UI framework for svelte + tailwind components

Keywords

FAQs

Package last updated on 07 Apr 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc