BlockDex

Components

Registries

Free blocks

Method

BlockDex

Components

Registries

Free blocks

Method

Open API

BlockDex

Components

Registries

Free blocks

Method

Open API

Components/blok/filter

Filter

blok/filter
FreeComponent

Filter components including input search, single select, multi select, and toggle filters for filtering data.

Install it

npx shadcn@latest add https://blok.sitecore.com/r/filter.json

Source

src/components/ui/filter.tsxblok.sitecore.com/r/filter.json · first 6 KB
1"use client";
2
3import { Badge } from "@/components/ui/badge";
4import { Button } from "@/components/ui/button";
5import { Checkbox } from "@/components/ui/checkbox";
6import {
7 Popover,
8 PopoverContent,
9 PopoverTrigger,
10} from "@/components/ui/popover";
11import {
12 SearchInput,
13 SearchInputClearButton,
14 SearchInputField,
15 SearchInputLeftElement,
16 SearchInputRightElement,
17} from "@/components/ui/search-input";
18import {
19 Select,
20 SelectContent,
21 SelectGroup,
22 SelectItem,
23 SelectLabel,
24 SelectTrigger,
25 SelectValue,
26} from "@/components/ui/select";
27import { Icon } from "@/lib/icon";
28import { cn } from "@/lib/utils";
29import { mdiCheck, mdiChevronDown, mdiClose, mdiMagnify } from "@mdi/js";
30import * as React from "react";
31import type { ComponentProps } from "react";
32
33const FILTER_DROPDOWN_WIDTH = "w-54 min-w-54";
34
35const FILTER_DROPDOWN_CONTAINER =
36 "rounded-lg border border-border bg-popover text-popover-foreground shadow-md outline-none";
37
38const FILTER_SELECT_TRIGGER_CLASSNAME =
39 "border-border text-md text-neutral-fg font-semibold outline-none focus-visible:ring-1 focus-visible:ring-ring/50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 bg-body-bg hover:bg-neutral-bg dark:bg-input/30 dark:hover:bg-input/50 flex w-fit min-w-0 max-w-full items-center justify-between gap-2 rounded-md border-1 px-3 py-2 whitespace-nowrap transition-[color] h-10 cursor-pointer disabled:cursor-not-allowed disabled:opacity-50 data-[state=open]:border-primary data-[state=open]:border-2 data-[state=open]:bg-primary-bg data-[state=open]:text-primary-fg data-[state=open]:hover:bg-primary-bg [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&>svg]:!text-current [&>svg]:!opacity-100";
40
41function FilterSingleSelectContent({
42 className,
43 children,
44 position = "popper",
45 ...props
46}: React.ComponentProps<typeof SelectContent>) {
47 return (
48 <SelectContent
49 data-slot="filter-single-select-content"
50 className={cn(
51 FILTER_DROPDOWN_WIDTH,
52 FILTER_DROPDOWN_CONTAINER,
53 "min-w-0 max-h-80 overflow-hidden p-0 [&_[data-slot=select-viewport]]:h-auto [&_[data-slot=select-viewport]]:min-w-0 [&_[data-slot=select-viewport]]:p-2 [&_[data-slot=select-viewport]]:max-h-80",
54 className,
55 )}
56 position={position}
57 {...props}
58 >
59 {children}
60 </SelectContent>
61 );
62}
63
64function getMultiSelectDisplayParts(
65 labels: string[],
66// … truncated

What it pulls in

npm packages

  • @mdi/js
  • class-variance-authority

Other registry items

  • https://blok.sitecore.com/r/theme.json
  • https://blok.sitecore.com/r/button.json
  • https://blok.sitecore.com/r/input.json
  • https://blok.sitecore.com/r/select.json
  • https://blok.sitecore.com/r/popover.json
  • https://blok.sitecore.com/r/badge.json
  • https://blok.sitecore.com/r/checkbox.json
  • https://blok.sitecore.com/r/search-input.json

Files it writes

  • src/components/ui/filter.tsx
  • src/lib/icon.tsx

Facts

Registry
blok
Type
registry:ui
Access
Free
Files written
2
Licence
NOASSERTION
First indexed
2026-08-01
Last confirmed
yesterday

Go to the source

blok.sitecore.com Sitecore/blok on GitHub Raw registry item This item as JSON

More from blok

All 72 items
Same registry, same kind — the ones you would have found next
ComponentRegistryKindAccessInstallsCommand
AccordionaccordionblokComponentsFree2 deps · 2 files
Action baraction-barblokComponentsFree1 dep · 2 files
AlertalertblokComponentsFree2 deps · 2 files
Alert dialogalert-dialogblokComponentsFree2 deps
Aspect ratioaspect-ratioblokComponentsFree1 dep
AvataravatarblokComponentsFree1 dep
BadgebadgeblokComponentsFree2 deps
All componentsblok-componentsblokComponentsFreeno deps
BlockDex

Built by

Kynth Studio

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

BlockDex

BlockDex

Built by

Kynth Studio

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

BlockDex

BlockDex

Built by

Kynth Studio

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

BlockDex