animated-table
jolyui-ui/animated-tableFreeComponent
jolyui/ui publishes no description for this item.
Live preview
live · rendered by the registry
Rendered by jolyui/ui on their own page — this is the component running, not a screenshot of it.Install it
npx shadcn@latest add https://jolyui.dev/r/animated-table.jsonSource
1import {2 Check,3 ChevronDown,4 ChevronLeft,5 ChevronRight,6 ChevronsLeft,7 ChevronsRight,8 ChevronsUpDown,9 ChevronUp,10 Columns3,11 Search,12 X,13} from "lucide-react";14import { AnimatePresence, motion } from "motion/react";15import * as React from "react";16import { cn } from "@/lib/utils";1718// Types19export type SortDirection = "asc" | "desc" | null;2021export interface ColumnDef<T> {22 id: string;23 header: React.ReactNode;24 accessorKey?: keyof T;25 cell?: (row: T, index: number) => React.ReactNode;26 sortable?: boolean;27 filterable?: boolean;28 align?: "left" | "center" | "right";29 width?: string;30 hideable?: boolean;31}3233export interface PaginationConfig {34 page: number;35 pageSize: number;36 totalItems: number;37 pageSizeOptions?: number[];38 onPageChange: (page: number) => void;39 onPageSizeChange?: (pageSize: number) => void;40}4142export interface AnimatedTableProps<T extends { id: string | number }> {43 data: T[];44 columns: ColumnDef<T>[];45 selectable?: boolean;46 selectedIds?: (string | number)[];47 onSelectionChange?: (ids: (string | number)[]) => void;48 onRowClick?: (row: T) => void;49 sortColumn?: string;50 sortDirection?: SortDirection;51 onSort?: (columnId: string, direction: SortDirection) => void;52 striped?: boolean;53 stickyHeader?: boolean;54 className?: string;55 emptyMessage?: React.ReactNode;56 loading?: boolean;57 loadingRows?: number;58 // New features59 searchable?: boolean;60 searchValue?: string;61 onSearchChange?: (value: string) => void;62 searchPlaceholder?: string;63 pagination?: PaginationConfig;64 expandable?: boolean;65 renderExpandedRow?: (row: T) => React.ReactNode;66 columnVisibility?: boolean;67 visibleColumns?: string[];68 onVisibleColumnsChange?: (columns: string[]) => void;69}7071// Search Input Component72const TableSearch = ({73 value,74 onChange,75 placeholder = "Search...",76}: {77 value: string;78 onChange: (value: string) => void;79 placeholder?: string;80}) => (81 <div className="relative">82 <Search className="absolute top-1/2 left-3 h-4 w-4 -translate-y-1/2 text-muted-foreground" />83 <input84 type="text"85 value={value}86 onChange={(e) => onChange(e.target.value)}87 placeholder={placeholder}88 className="h-9 w-full rounded-md border border-table-border bg-background pr-8 pl-9 text-foreground text-sm placeholder:text-muted-foreground focus:border-primary focus:outline-none focus:ring-1 focus:ring-primary"89 />90 <AnimatePresence>91 {value && (92 <motion.button93// … truncated
What it pulls in
npm packages
Files it writes
More from jolyui/ui
All 199 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| ai-prompt-boxai-prompt-box | jolyui/ui | Components | Free | 4 deps | |
| animated-beamanimated-beam | jolyui/ui | Components | Free | 1 dep | |
| animated-theme-toggleanimated-theme-toggle | jolyui/ui | Components | Free | 2 deps | |
| animated-toastanimated-toast | jolyui/ui | Components | Free | 2 deps | |
| animated-tooltipanimated-tooltip | jolyui/ui | Components | Free | 1 dep | |
| bento-gridbento-grid | jolyui/ui | Components | Free | no deps | |
| buttonbutton | jolyui/ui | Components | Free | 3 deps | |
| calendercalender | jolyui/ui | Components | Free | 3 deps |
