Home / File/ data-table-faceted-filter.tsx — ui Source File

data-table-faceted-filter.tsx — ui Source File

Architecture documentation for data-table-faceted-filter.tsx, a tsx file in the ui codebase. 9 imports, 1 dependents.

File tsx ComponentRegistry UIPrimitives 9 imports 1 dependents 1 functions

Entity Profile

Dependency Diagram

graph LR
  6ef7e23d_8854_babe_35fb_fc0ef77c5cfd["data-table-faceted-filter.tsx"]
  1d141819_425e_b5fd_4c8e_32f7c6a42cf2["react"]
  6ef7e23d_8854_babe_35fb_fc0ef77c5cfd --> 1d141819_425e_b5fd_4c8e_32f7c6a42cf2
  eff11612_0b61_f7f9_e13e_9117a7062bb3["react-table"]
  6ef7e23d_8854_babe_35fb_fc0ef77c5cfd --> eff11612_0b61_f7f9_e13e_9117a7062bb3
  d39cd1e4_1b2d_9aa2_1d29_fd0b4bfb61c3["lucide-react"]
  6ef7e23d_8854_babe_35fb_fc0ef77c5cfd --> d39cd1e4_1b2d_9aa2_1d29_fd0b4bfb61c3
  79081a1f_55a3_945a_fb8c_d53d6d3eab81["utils"]
  6ef7e23d_8854_babe_35fb_fc0ef77c5cfd --> 79081a1f_55a3_945a_fb8c_d53d6d3eab81
  d1f6969b_47e1_9226_0001_415be23d60e0["badge"]
  6ef7e23d_8854_babe_35fb_fc0ef77c5cfd --> d1f6969b_47e1_9226_0001_415be23d60e0
  aa2f3ec6_f291_3763_88ec_65a3f5ad5939["button"]
  6ef7e23d_8854_babe_35fb_fc0ef77c5cfd --> aa2f3ec6_f291_3763_88ec_65a3f5ad5939
  64c05bed_da32_06a4_3b53_12b3830eb50b["command"]
  6ef7e23d_8854_babe_35fb_fc0ef77c5cfd --> 64c05bed_da32_06a4_3b53_12b3830eb50b
  e33b0d79_0534_28ec_a112_ac16ee736e09["popover"]
  6ef7e23d_8854_babe_35fb_fc0ef77c5cfd --> e33b0d79_0534_28ec_a112_ac16ee736e09
  0ef877d6_b768_4222_bd20_50d875ac5e58["separator"]
  6ef7e23d_8854_babe_35fb_fc0ef77c5cfd --> 0ef877d6_b768_4222_bd20_50d875ac5e58
  9e526a92_77ee_c36b_75b6_45f175bc15ec["data-table-toolbar.tsx"]
  9e526a92_77ee_c36b_75b6_45f175bc15ec --> 6ef7e23d_8854_babe_35fb_fc0ef77c5cfd
  style 6ef7e23d_8854_babe_35fb_fc0ef77c5cfd fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

import * as React from "react"
import { Column } from "@tanstack/react-table"
import { Check, PlusCircle } from "lucide-react"

import { cn } from "@/lib/utils"
import { Badge } from "@/registry/new-york/ui/badge"
import { Button } from "@/registry/new-york/ui/button"
import {
  Command,
  CommandEmpty,
  CommandGroup,
  CommandInput,
  CommandItem,
  CommandList,
  CommandSeparator,
} from "@/registry/new-york/ui/command"
import {
  Popover,
  PopoverContent,
  PopoverTrigger,
} from "@/registry/new-york/ui/popover"
import { Separator } from "@/registry/new-york/ui/separator"

interface DataTableFacetedFilterProps<TData, TValue> {
  column?: Column<TData, TValue>
  title?: string
  options: {
    label: string
    value: string
    icon?: React.ComponentType<{ className?: string }>
  }[]
}

export function DataTableFacetedFilter<TData, TValue>({
  column,
  title,
  options,
}: DataTableFacetedFilterProps<TData, TValue>) {
  const facets = column?.getFacetedUniqueValues()
  const selectedValues = new Set(column?.getFilterValue() as string[])

  return (
    <Popover>
      <PopoverTrigger asChild>
        <Button variant="outline" size="sm" className="h-8 border-dashed">
          <PlusCircle />
          {title}
          {selectedValues?.size > 0 && (
            <>
              <Separator orientation="vertical" className="mx-2 h-4" />
              <Badge
                variant="secondary"
                className="rounded-sm px-1 font-normal lg:hidden"
              >
                {selectedValues.size}
              </Badge>
              <div className="hidden space-x-1 lg:flex">
                {selectedValues.size > 2 ? (
                  <Badge
                    variant="secondary"
// ... (88 more lines)

Subdomains

Dependencies

  • badge
  • button
  • command
  • lucide-react
  • popover
  • react
  • react-table
  • separator
  • utils

Frequently Asked Questions

What does data-table-faceted-filter.tsx do?
data-table-faceted-filter.tsx is a source file in the ui codebase, written in tsx. It belongs to the ComponentRegistry domain, UIPrimitives subdomain.
What functions are defined in data-table-faceted-filter.tsx?
data-table-faceted-filter.tsx defines 1 function(s): DataTableFacetedFilter.
What does data-table-faceted-filter.tsx depend on?
data-table-faceted-filter.tsx imports 9 module(s): badge, button, command, lucide-react, popover, react, react-table, separator, and 1 more.
What files import data-table-faceted-filter.tsx?
data-table-faceted-filter.tsx is imported by 1 file(s): data-table-toolbar.tsx.
Where is data-table-faceted-filter.tsx in the architecture?
data-table-faceted-filter.tsx is located at deprecated/www/app/(app)/examples/tasks/components/data-table-faceted-filter.tsx (domain: ComponentRegistry, subdomain: UIPrimitives, directory: deprecated/www/app/(app)/examples/tasks/components).

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free