JGuang

Filter Table

Filter Table · Beautiful UI

Preview
npx shadcn@latest add https://jiguang132.com/r/beautiful-ui/filter-table.json

Filter Table

Install: npx shadcn@latest add https://jiguang132.com/r/beautiful-ui/filter-table.json

When to use

Filter and sort a small task list by its displayed fields.

Key props and data

Native propMeaning
rowsEach item requires task, date, status and owner; status is todo/progress/done.
labelsIf supplied, include all four columns: task, date, status and owner.

Interaction and state checks

Test each native status, combined filters and a no-match result. Keep the public status values unchanged when translating visible names.

Integration boundaries

The native filters are local, not a server pagination/search protocol. Do not pass partial column labels or invent extra status values.

The runnable usage and source reference below preserve the native API. These practical guides do not claim a full translation of upstream prose.

Runnable usage

Install a complete example below first, then import its installed entry. Parameterized example source, shared helpers, native components and CSS are included; no manual relative-import edits are required.

import Demo from '@/components/beautiful-ui/examples/presets/filter-table-task-filters';
import '@/styles/beautiful-ui.css';
export default function Example() { return <Demo />; }

Preview states

Default, Task filters

Demo state and mock data do not provide a backend service. Inspect the component props before wiring real data.

Status chips that reorganize live data.

Complete example installation

These are runnable native states and parameterized usage scenarios, not additional components. Each bundle includes its source closure, helpers, pinned dependencies, independent CSS and licenses. Scenario names are not new native component props; consult the source API below.

Default

npx shadcn@latest add https://jiguang132.com/r/beautiful-ui/examples/filter-table/filter-table-default.json

Default import: @/components/beautiful-ui/examples/presets/filter-table-default

Dependencies: clsx@2.1.1, tailwind-merge@3.6.0, shadow-plugin@2.1.1

Task filters

npx shadcn@latest add https://jiguang132.com/r/beautiful-ui/examples/filter-table/filter-table-task-filters.json

Default import: @/components/beautiful-ui/examples/presets/filter-table-task-filters

Dependencies: clsx@2.1.1, tailwind-merge@3.6.0, shadow-plugin@2.1.1

Initialize Tailwind CSS v4, import beautiful-ui.css once and synchronize theme with the host html dark class. Examples read html lang for Chinese/English and do not supply backend, authentication or recording. Network/clipboard availability still depends on the browser.

Source-backed parameter reference

Implementation signatures and types are generated from the pinned local source. Optional props, native inherited types, union branches and never exclusions are preserved. A forwardRef implementation's ref is a React reference, not an additional business prop.

FilterTable({
  rows = ROWS,
  labels = LABELS,
}: {
  rows?: TableRow[];
  labels?: FilterTableLabels;
  variant?: string;
} = {})
type Status = "todo" | "progress" | "done";

export type TableRow = { task: string; date: string; status: Status; owner: string };

export type FilterTableLabels = {
  columns: { task: string; date: string; status: string; owner: string };
};

Destructuring defaults in source

Only defaults written directly in parameter/props destructuring are listed. Conditional expressions, runtime theme and computed values require source inspection; this is not an exhaustive behavior-default list.

// FilterTable
rows = ROWS

// FilterTable
labels = LABELS