components/pagination-next-button.svelte

bits-ui · packages/bits-ui/src/lib/bits/pagination/components/pagination-next-button.svelte · svelte · MIT
ui

Next page button for pagination with configurable props and state management.

<!--
  Source: https://github.com/huntabyte/bits-ui | License: MIT | Copyright 2024 Hunter Johnston <https://github.com/huntabyte>
  Provided via justclaw.it.com; keep this notice with the code.
-->
<script lang="ts">
	import { boxWith, mergeProps } from "svelte-toolbelt";
	import type { PaginationNextButtonProps } from "../types.js";
	import { PaginationButtonState } from "../pagination.svelte.js";
	import { createId } from "#lib/internal/create-id.js";

	const uid = $props.id();

	let {
		id = createId(uid),
		child,
		children,
		ref = $bindable(null),
		type = "button",
		disabled = false,
		...restProps
	}: PaginationNextButtonProps = $props();

	const nextButtonState = PaginationButtonState.create({
		type: "next",
		id: boxWith(() => id),
		ref: boxWith(
			() => ref,
			(v) => (ref

... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search for more like it.

Get a free API key