shipshitdev

table-filters

4
0
# Install this skill:
npx skills add shipshitdev/library --skill "table-filters"

Install specific skill from multi-skill repository

# Description

Designs optimal filtering UX for data tables. Use when building a table that needs filters - analyzes the data columns and determines the best filter type for each. Outputs a unified filter field with inline header filters.

# SKILL.md


name: table-filters
description: Designs optimal filtering UX for data tables. Use when building a table that needs filters - analyzes the data columns and determines the best filter type for each. Outputs a unified filter field with inline header filters.


Table Filters

When the user is building a table that needs filters, analyze the columns and design the filtering UX.

Step 1: Analyze Each Column

For each column in the table, determine the filter type:

Data Pattern Filter Type Example Columns
Free text, names, descriptions Contains Product Name, Notes, Customer
Fixed set of values (<20 options) Checkboxes Status, Category, Priority, Type
Numeric values Range Price, Quantity, Age, Score
Dates Date Range Created, Updated, Due Date
Boolean Toggle Active, Verified, Published

Step 2: Implement the Filter Layout

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ [Filter chips go here...] [πŸ” Filter or search...]  [βœ•] β”‚  ← Unified filter field
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                                          Sort by: [Dropdown β–Ύ]

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ Name       β–Ό β”‚ Status     β–Ό β”‚ Price      β–Ό β”‚ Created    β–Ό β”‚  ← Clickable headers with filter icon
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚ ...          β”‚ ...          β”‚ ...          β”‚ ...          β”‚

Key layout rules:

  • Filter field spans table width, contains chips + search input + clear button
  • Sort dropdown next to filter field (not in headers)
  • Each header is clickable and opens its filter menu
  • Menu appears ABOVE field when filtering (inserts chip directly)

Step 3: Build Each Filter Component

Contains Filter (text)

β”Œβ”€ Product Name ──────────── βœ• ─┐
β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”β”‚
β”‚ β”‚ Search...                  β”‚β”‚
β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Chip result: Product Name: system

Checkbox Filter (categories)

β”Œβ”€ Status ──────────────── βœ• ─┐
β”‚ β˜‘ Active                     β”‚
β”‚ β˜‘ Pending                    β”‚
β”‚ ☐ Archived                   β”‚
β”‚ ☐ Deleted                    β”‚
β”‚            [Clear] [Apply]   β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Chip result: Status: Active, Pending or Status: Active, +2

Range Filter (numeric)

β”Œβ”€ Price ─────────────────── βœ• ─┐
β”‚  Min         Max              β”‚
β”‚ β”Œβ”€β”€β”€β”€β”€β”     β”Œβ”€β”€β”€β”€β”€β”           β”‚
β”‚ β”‚ 0   β”‚  -  β”‚ 100 β”‚           β”‚
β”‚ β””β”€β”€β”€β”€β”€β”˜     β””β”€β”€β”€β”€β”€β”˜           β”‚
β”‚ ○───────────────●─────○       β”‚  ← Optional slider
β”‚              [Apply]          β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Chip result: Price: $0 - $100

Date Range Filter

β”Œβ”€ Created ─────────────────── βœ• ─┐
β”‚  From           To              β”‚
β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”   β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”     β”‚
β”‚ β”‚ 01/01/25 β”‚ - β”‚ 12/31/25 β”‚     β”‚
β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜   β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜     β”‚
β”‚ [Today] [This week] [This month]β”‚
β”‚                [Apply]          β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Chip result: Created: Jan 1 - Dec 31, 2025

Chip Design Rules

  • Dark background, light text, rounded pill shape
  • X button on contrasting surface (clearly clickable)
  • Truncate after 2 values: Status: Active, Pending, +3
  • Clicking chip reopens its filter menu

Empty State

When filters return no results:

     β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
     β”‚   (β•―Β°β–‘Β°)β•―   β”‚
     β”‚   οΈ΅ ┻━┻    β”‚
     β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
   No results found
   Try adjusting your filters

   [Clear all filters]

Quick Checklist

When implementing, verify:

  • [ ] Each column has appropriate filter type assigned
  • [ ] Filter field contains chips (not separate row above)
  • [ ] Sort is dropdown, not toggle icons in headers
  • [ ] Chip shows max 2 values, then +N
  • [ ] Clear all button at end of filter field
  • [ ] Empty state has clear action

HTML Class Reference

Use these classes for styling compatibility with html-style:

Element Class Purpose
Filter container .filter-bar Top-level filter row
Chip container .filter-chips Holds all active chips
Individual chip .chip Single filter chip
Chip remove .chip-remove X button on chip
Search input .filter-search Text search field
Clear all .filter-clear Clear all filters button
Sort control .sort-control Sort dropdown container
Filter menu .filter-menu Dropdown filter panel
Empty state .empty-state No results container

Data attributes:

  • data-column β€” Column identifier on chips
  • data-filter-type β€” Filter type (contains/checkbox/range/date)

Styling Handoff

This skill outputs semantic HTML with class names. For visual styling, invoke the html-style skill after generating filter HTML.

# Supported AI Coding Agents

This skill is compatible with the SKILL.md standard and works with all major AI coding agents:

Learn more about the SKILL.md standard and how to use these skills with your preferred AI coding agent.