BlockDex

Components

Registries

Free blocks

Method

BlockDex

Components

Registries

Free blocks

Method

Open API

BlockDex

Components

Registries

Free blocks

Method

Open API

Components/Supabase UI Library/infinite-query-hook

Infinite Query Hook

supabase-ui-library/infinite-query-hook
UnverifiedBlock

React hook for infinite lists, fetching data from Supabase.

Install it

npx shadcn@latest add https://raw.githubusercontent.com/aimultiple-benchmark/supabase-bench-gre-2/main/apps/ui-library/public/r/infinite-query-hook.json

Source

registry/default/blocks/infinite-query-hook/hooks/use-infinite-query.tsraw.githubusercontent.com/aimultiple-benchmark/supabase-bench-gre-2/main/apps/ui-library/public/r/infinite-query-hook.json · first 6 KB
1'use client'
2
3import { PostgrestQueryBuilder, type PostgrestClientOptions } from '@supabase/postgrest-js'
4import { type SupabaseClient } from '@supabase/supabase-js'
5import { useEffect, useMemo, useRef, useSyncExternalStore } from 'react'
6
7import { createClient } from '@/registry/default/fixtures/lib/supabase/client'
8
9const supabase = createClient()
10
11// The following types are used to make the hook type-safe. It extracts the database type from the supabase client.
12type SupabaseClientType = typeof supabase
13
14// Utility type to check if the type is any
15type IfAny<T, Y, N> = 0 extends 1 & T ? Y : N
16
17// Extracts the database type from the supabase client. If the supabase client doesn't have a type, it will fallback properly.
18type Database =
19 SupabaseClientType extends SupabaseClient<infer U>
20 ? IfAny<
21 U,
22 {
23 public: {
24 Tables: Record<string, any>
25 Views: Record<string, any>
26 Functions: Record<string, any>
27 }
28 },
29 U
30 >
31 : {
32 public: {
33 Tables: Record<string, any>
34 Views: Record<string, any>
35 Functions: Record<string, any>
36 }
37 }
38
39// Change this to the database schema you want to use
40type DatabaseSchema = Database['public']
41
42// Extracts the table names from the database type
43type SupabaseTableName = keyof DatabaseSchema['Tables']
44
45// Extracts the table definition from the database type
46type SupabaseTableData<T extends SupabaseTableName> = DatabaseSchema['Tables'][T]['Row']
47
48// Default client options for PostgrestQueryBuilder
49type DefaultClientOptions = PostgrestClientOptions
50
51type SupabaseSelectBuilder<T extends SupabaseTableName> = ReturnType<
52 PostgrestQueryBuilder<
53 DefaultClientOptions,
54 DatabaseSchema,
55 DatabaseSchema['Tables'][T],
56 T
57 >['select']
58>
59
60// A function that modifies the query. Can be used to sort, filter, etc. If .range is used, it will be overwritten.
61type SupabaseQueryHandler<T extends SupabaseTableName> = (
62 query: SupabaseSelectBuilder<T>
63) => SupabaseSelectBuilder<T>
64
65interface UseInfiniteQueryProps<T extends SupabaseTableName, Query extends string = '*'> {
66 // The table name to query
67 tableName: T
68 // The columns to select, defaults to `*`
69 columns?: string
70 // The number of items to fetch per page, defaults to `20`
71 pageSize?: number
72 // A function that modifies the query. Can be used to sort, filter, etc. If .range is used, it will be overwritten.
73// … truncated

What it pulls in

npm packages

  • @supabase/supabase-js
  • @supabase/postgrest-js@*

Files it writes

  • registry/default/blocks/infinite-query-hook/hooks/use-infinite-query.ts

Facts

Registry
Supabase UI Library
Type
registry:block
Access
Unverified
Files written
1
Licence
the repository states none
In the index
at or before 2026-08-13
Last confirmed
yesterday

Go to the source

supabase.com DrAkhilKolli/ExperimentSupabase on GitHub Raw registry item This item as JSON

More from Supabase UI Library

All 2 items
Same registry, same kind — the ones you would have found next
ComponentRegistryKindAccessInstallsCommand
Current User Avatarcurrent-user-avatar-nuxtjsSupabase UI LibraryBlocksUnverified1 dep · 3 files
Current User Avatarcurrent-user-avatar-vueSupabase UI LibraryBlocksUnverified1 dep · 3 files
Dropzone (File Upload) for Nuxt and Supabasedropzone-nuxtjsSupabase UI LibraryBlocksUnverified3 deps · 4 files
Dropzone (File Upload) for Vue and Supabasedropzone-vueSupabase UI LibraryBlocksUnverified3 deps · 4 files
Password Based Auth flow for Nextjs and Supabasepassword-based-auth-nextjsSupabase UI LibraryBlocksUnverified2 deps · 17 files
Password Based Auth flow for Nuxt.js and Supabasepassword-based-auth-nuxtjsSupabase UI LibraryBlocksUnverified2 deps · 12 files
Password Based Auth flow for React and Supabasepassword-based-auth-reactSupabase UI LibraryBlocksUnverified1 dep · 5 files
Password Based Auth flow for React Router and Supabasepassword-based-auth-react-routerSupabase UI LibraryBlocksUnverified4 deps · 11 files

Also from Kynth Studios

Built for the same person as BlockDex

SkillWorks

Claude Code skills and plugins, scored

skillworks.kynth.studio

RuleStack

AGENTS.md gallery and agent-config comparison

rulestack.kynth.studio

ToolDrift

What the AI coding tools changed last night

tooldrift.kynth.studio

The studio list

One product, taken apart, once a month

Kynth Studios pulls one shipped product open every month — what it does, what it cost to build, what the pipeline behind it looks like, and what the numbers did. One email a month, nothing in between.

Double opt-in — we send one confirmation link and nothing else until you click it.

BlockDex

Built by

Kynth Studios

the studio behind SkillWorks, RuleStack and ToolDrift

part of Toolproof, the measurement layer for AI agent tooling

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

© 2026 BlockDex. A Kynth Studios product. Changelog

BlockDex

The studio list

One product, taken apart, once a month

Kynth Studios pulls one shipped product open every month — what it does, what it cost to build, what the pipeline behind it looks like, and what the numbers did. One email a month, nothing in between.

Double opt-in — we send one confirmation link and nothing else until you click it.

BlockDex

Built by

Kynth Studios

the studio behind SkillWorks, RuleStack and ToolDrift

part of Toolproof, the measurement layer for AI agent tooling

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

© 2026 BlockDex. A Kynth Studios product. Changelog

BlockDex

The studio list

One product, taken apart, once a month

Kynth Studios pulls one shipped product open every month — what it does, what it cost to build, what the pipeline behind it looks like, and what the numbers did. One email a month, nothing in between.

Double opt-in — we send one confirmation link and nothing else until you click it.

BlockDex

Built by

Kynth Studios

the studio behind SkillWorks, RuleStack and ToolDrift

part of Toolproof, the measurement layer for AI agent tooling

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

© 2026 BlockDex. A Kynth Studios product. Changelog

BlockDex