Search Inputs (Data Tables)

Back

Component Description(Generated by AI)

How It Works

When the user types, the search dispatches an ms:search event to the target list container. The card view, table view and Kanban view list scripts listen for this event, filter their full in-memory record cache, recalculate pagination, and re-render.

Where do results appear? In the existing list/table/board you already have on the page. The search input never duplicates the data it just narrows what's shown. The "no results" message and result count appear inside the search wrapper itself.

Setup

This component requires an accompanying script. Drop the search wrapper anywhere on the page, point it at your list, and you're done.

  • ms-code-target — CSS selector for the list container(s) to filter (default: [data-ms-code='list-container']). Use [data-ms-code='kanban-container'] for kanban boards. Match multiple lists by separating selectors with commas
  • ms-code-search-fields — (optional) comma-separated list of data-ms-field keys to search within (e.g. task,notes,priority). Leave empty to search every field on each record
  • ms-code-row-selector — (optional, fallback only) explicit CSS selector for rows when a list doesn't listen for ms:search. Auto-detected for built-in components
  • ms-code-debounce — milliseconds to wait after typing stops before filtering (default: 200)
  • ms-code-min-chars — minimum characters required before filtering kicks in (default: 1)

Pairing with the Card List View

The default ms-code-target already matches the list container. Place the search wrapper anywhere on the page — typically above the list. The search will filter across all records loaded by the list (up to its MAX_RECORDS ceiling), regardless of pagination.

Pairing with the Table List View

Same as card list view — the default target works. If you have multiple tables on the page (e.g. "All Todos" and "My Todos"), give each one a unique selector and pair each with its own search input:

<!-- Search for the "All Todos" table only -->
<div data-ms-code="search" ms-code-target="#all-todos">...</div>
<div id="all-todos" data-ms-code="list-container" ms-code-table="todos">...</div>

<!-- Search for the "My Todos" table only -->
<div data-ms-code="search" ms-code-target="#my-todos">...</div>
<div id="my-todos" data-ms-code="list-container" ms-code-table="todos" ms-code-owner-field="owner">...</div>

Pairing with the Kanban Board

Change ms-code-target to point at the kanban container:

<div data-ms-code="search"
ms-code-target="[data-ms-code='kanban-container']"
ms-code-search-fields="task,notes">
...
</div>

Cards that don't match are hidden across all columns. Empty columns simply appear empty, the kanban's column-count badges keep showing the unfiltered totals on purpose so users understand they're filtering, not deleting.

Key Features

  • Filters across all paginated records, not just the current page — works at the data level via the ms:search event
  • Live result count using a customizable template ({visible} of {total} results)
  • Pagination automatically recalculates based on filtered results — page 1 of 5 might become page 1 of 2 when filtering narrows the dataset
  • Pure client-side filtering — no extra API calls, no rate-limit impact, instant results
  • Optional field allow-list — search only specific fields like task and notes, ignoring priority or status
  • Debounced input prevents lag while typing on long lists
  • "No results" state shown when nothing matches
  • Clear button appears as soon as the input has text
  • Press Escape to clear the search and restore all rows
  • Multiple search inputs per page — each one targets its own list independently

Custom Lists

If you have a custom list component, the search input falls back to client-side DOM filtering automatically. To make a custom list participate in data-level filtering, have it listen for ms:search on its container element:

container.addEventListener('ms:search', function(e) {
e.preventDefault(); // tell the search input you'll handle it
var query = (e.detail.query || '').toLowerCase();
var fields = e.detail.fields || [];
// Filter your records and re-render here
// Then optionally dispatch ms:search:result back so the count UI updates:
container.dispatchEvent(new CustomEvent('ms:search:result', {
detail: { visible: filtered.length, total: all.length, query: query }
}));
});

Potential Use Cases

  • Any Memberstack-powered site with list, table, or board views that benefit from quick-find
  • Task lists, customer directories, project catalogs, content libraries, hiring pipelines, order histories, inventory, and more
  • Drop in next to any existing list component — no markup changes needed in the list itself for the built-in components

Related Components

More components you might find useful

Edit Data Table Records
View Component
Data Tables

Edit Data Table Records

This component requires an accompanying script. Update the following attribute values in the HTML to match your data table and fields before use: ms-code-table — set to your data table name (default: "todos") ms-code-id-param — set to the URL query parameter that holds the record ID (default: id) ms-code-owner-field — set to the field that stores the member ID ms-code-redirect — (optional) set to the page URL to redirect after a successful update data-ms-field on each input — set to the matching field key in your table ms-field on each input — set to the field type: text, number, date, checkbox, html, image, or link Look for /* CUSTOMIZE */ comments in the script for additional options Linking from the Card List View The Card List View component generates a link on each card using ms-code-detail-page and ms-code-id-param. To have cards link to this edit page: Set ms-code-detail-page on the Card List View wrapper to the URL of your edit page (e.g. /edit) Make sure ms-code-id-param matches on both components (default: id) The card link will resolve to something like /edit?id=abc123, and this component reads that ID on load. Key Features Reads the record ID from the URL query string and fetches the existing record on page load Pre-populates all form fields with saved values, handling every ms-field type: text and html set the input value, number sets the value directly, date converts ISO to YYYY-MM-DD for the date picker, checkbox sets the checked state, image and link set URL values Updates the record in place via Memberstack's updateDataRecord API on submit Collects fields on submit with full type awareness: number parses to float, date converts to ISO, checkbox reads checked state, text/html/image/link pass raw strings Authenticates the current member and stamps the owner field on every save Shows loading, success, and error states with smooth fade-in transitions Gracefully handles missing or deleted records with an inline error message Supports optional redirect after successful update Potential Use Cases Any Memberstack-powered site that needs a user-facing edit form tied to a data table Task managers, project trackers, CRMs, support ticket systems, inventory updates, and more Swap the table name and fields to match any data model — the script handles the rest

Create Data Table Record
View Component
Data Tables

Create Data Table Record

This component requires an accompanying script. Update the following attribute values in the HTML to match your data table and fields before use: ms-code-table — set to your data table name (default: "todos") ms-code-owner-field — set to the field that stores the member ID ms-code-redirect — (optional) set to the page URL to redirect after success data-ms-field on each input — set to the matching field key in your table ms-field on each input — set to the field type: text, number, date, checkbox, html, image, or link Look for /* CUSTOMIZE */ comments in the script for additional options Key Features Auto-binds form inputs to data table columns via data attributes Handles every ms-field type when collecting values: text and html pass raw strings, number parses to float, date converts to ISO, checkbox reads the checked state, image and link pass URLs Authenticates the current member and stamps owner + creation date on every record Shows loading, success, and error states with smooth fade-in transitions Prevents Webflow's native form handler from hiding the form Supports optional redirect after successful creation Potential Use Cases Any Memberstack-powered site that needs a user-facing create form tied to a data table Task managers, project trackers, CRMs, support ticket systems, inventory forms, and more Swap the table name and fields to match any data model — the script handles the rest

View Data Table Records
View Component
Data Tables

View Data Table Records

This component requires an accompanying script. Update the following attribute values in the HTML to match your data table and fields before use: ms-code-table — set to your data table name (on both the wrapper and the template; default: "todos") ms-code-sort — set to the field and direction for sorting (e.g. created_at:desc) ms-code-per-page — set to the number of cards to show per page ms-code-detail-page — set to the URL of the detail/edit page (e.g. /edit) ms-code-id-param — set to the URL query parameter name for the record ID (default: id) ms-code-owner-field — (optional) set on the template to filter records by the logged-in member data-ms-field on each display element — set to the matching field key in your table ms-field on each display element — set to the field type: text, number, date, checkbox, html, image, or link Key Features Fetches all records from the specified Memberstack data table on page load Renders a card for each record using a cloneable template pattern Binds data-ms-field elements to record values with full type-aware rendering: text sets textContent, number formats with locale separators, date formats to a readable string, checkbox displays "Yes" or "No", html sets innerHTML, image sets src, link sets href Generates detail page links with the record ID as a query parameter Client-side pagination with configurable page size Numbered page buttons, previous/next navigation with disabled state styling Supports sorting by any field in ascending or descending order Optional owner filtering to show only the logged-in member's records Four distinct UI states: loading, populated list, empty, and error Retry button on error state to re-attempt the fetch Potential Use Cases Any Memberstack-powered site that needs a browsable record list with card layout Task managers, project dashboards, CRM contact lists, product catalogs, and more Swap the table name and fields to match any data model — the script handles the rest

Record Details Page (Data Tables)
View Component
Data Tables

Record Details Page (Data Tables)

This component requires an accompanying script. Update the following attribute values on the detail wrapper to match your data table: ms-code-table — your data table name (default: "todos") ms-code-id-param — URL query parameter name for the record ID (default: id). Must match what the linking list view uses ms-code-owner-field — (optional) field that stores the owner's member ID; if set, the page only shows the record when the current member matches; otherwise the error state appears ms-code-edit-page — (optional) URL of the edit page (e.g. /edit). The script populates the Edit button's href with this URL plus ?id=... ms-code-delete-page — (optional) URL of the delete confirmation page (e.g. /delete). The script populates the Delete button's href the same way data-ms-field on each display element — set to the matching field key in your table ms-field on each display element — set to the field type: text, number, date, checkbox, html, image, or link Linking from the Card List, Table List, or Kanban The list-style components (Card List, Table List, and Kanban Board) generate per-record links using ms-code-detail-page and ms-code-id-param. To send users to this detail page when they click a card, row, or kanban card: Set ms-code-detail-page on the list/table/kanban container to the URL of this detail page (e.g. /detail) Make sure ms-code-id-param matches on both the list and the detail container (default: id) Inside each card or row, include an element with data-ms-code="detail-link" — the list scripts populate its href automatically with the record ID The card link will resolve to something like /detail?id=abc123, and this component reads that ID on load. Recommended Page Structure The detail page sits at the center of a typical CRUD flow. A clean, conventional setup looks like this: /todos — Card List or Table List view /board — Kanban Board /detail — Record Detail page (this component) /edit — Edit form /delete — Delete confirmation /new — Create form Wire each list-style page to the detail page via ms-code-detail-page="/detail". On the detail page, point Edit and Delete to their dedicated pages via ms-code-edit-page="/edit" and ms-code-delete-page="/delete". The same record ID flows through every URL as the ?id=... query parameter, so the chain works end-to-end without any custom JS. Page names are arbitrary. The slugs above (/detail, /edit, /delete, etc.) are conventions, not magic strings. Name your pages anything — /task-overview, /aufgabe-bearbeiten, /dashboard/tasks/view, etc. — and just plug those URLs into the matching ms-code-*-page attributes. The only values that actually need to line up across pages are ms-code-table (must match your data table key) and ms-code-id-param (must use the same query parameter name on every page so the record ID hands off correctly). Key Features Reads the record ID from the URL on load and fetches the record via getDataRecord Type-aware field rendering: text sets textContent, number formats with locale separators, date formats to a readable string, checkbox displays "Yes" or "No", html sets innerHTML, image sets src or background-image, link sets href Optional ownership check via ms-code-owner-field — non-owners see the error state instead of someone else's record Auto-generates Edit and Delete button URLs by combining ms-code-edit-page / ms-code-delete-page with the current record ID — no JS needed to wire navigation Three UI states: loading, populated content, and error (which doubles as "not found" and "not your record") Handles 429 rate-limit responses automatically with exponential-backoff retries Multiple detail containers supported on the same page if needed (rare, but it works) Action Buttons The default HTML includes three action buttons in the footer of the content block: Back to list — a plain <a href="/todos"> link; update the href to your list page Edit — has data-ms-code="edit-link"; the script populates the href with the edit page URL plus ?id=... Delete — has data-ms-code="delete-link"; the script populates the href the same way Remove any button you don't need by deleting it from the HTML. To skip the Edit or Delete URL population, simply omit ms-code-edit-page or ms-code-delete-page from the wrapper. Full Attribute Reference Three categories of attributes drive this component. Use this section as a complete spec when wiring up the markup. 1. Container Attributes (on the detail wrapper) data-ms-code="detail-container" — required. Marks this element as the detail wrapper. The script initializes one instance per matching element. ms-code-table — required. The Memberstack data table key to fetch from. Example: ms-code-table="todos". ms-code-id-param — optional, defaults to id. URL query parameter name that holds the record ID. Example: ms-code-id-param="recordId". ms-code-owner-field — optional. Field key that stores the owner's member ID. When set, the page only shows the record if the current member matches; non-owners see the error state. Example: ms-code-owner-field="owner". ms-code-edit-page — optional. URL of the edit page. Used to populate the Edit button's href. Example: ms-code-edit-page="/edit". ms-code-delete-page — optional. URL of the delete confirmation page. Used to populate the Delete button's href. Example: ms-code-delete-page="/delete". 2. Element Role Attributes (data-ms-code values inside the container) detail-loading — recommended. Shown while fetching the record. Add style="display:none" to the element so it doesn't flash on page load. detail-error — recommended. Shown if the fetch fails, the record can't be found, or the ownership check rejects the user. Add style="display:none". detail-content — required. Wraps everything that should appear once the record loads. The script reveals it after populating fields. Add style="display:none". edit-link — optional. An <a> button whose href the script will populate as {edit-page}?{id-param}={recordId}. Leave href="#" as a placeholder. delete-link — optional. Same behavior as edit-link, but uses ms-code-delete-page. Leave href="#" as a placeholder. 3. Field Display Attributes Use both data-ms-field (which field) and ms-field (how to render it) on each display element. ms-field defaults to text if omitted. ms-field="text" (default) — sets the element's textContent to the field value. Use on any text element: <span>, <p>, <h1>–<h6>, <div>. Example: <h1 data-ms-field="task">Loading…</h1> ms-field="number" — parses the value as a float and formats with locale separators (e.g. 1234 → "1,234"). Use on any text element. Example: <span data-ms-field="count" ms-field="number">0</span> ms-field="date" — parses the ISO date string and formats it with toLocaleDateString using DATE_OPTIONS from the script (default: "Apr 16, 2026"). Use on any text element. Example: <p data-ms-field="dueDate" ms-field="date">—</p> ms-field="checkbox" — displays the customizable BOOLEAN_TRUE / BOOLEAN_FALSE labels (default: "Yes" / "No") based on the field's truthiness. Use on any text element. Example: <span data-ms-field="is_complete" ms-field="checkbox">No</span> ms-field="html" — sets innerHTML to the field value. Use only with trusted content — does not sanitize. Use on any container: <div>, <article>, etc. Example: <div data-ms-field="bio" ms-field="html"></div> ms-field="image" — if on an <img>, sets src. On any other element, sets style.backgroundImage to url(value). Use <img> for inline images, or any <div> for background-image use cases (cards, hero banners, avatars). Example: <img data-ms-field="cover" ms-field="image" src="" alt=""> ms-field="link" — if on an <a>, sets href. On any other element, sets textContent as a fallback. Use <a> for clickable links. Example: <a data-ms-field="website" ms-field="link" href="#">Visit</a> Field display elements can live anywhere inside data-ms-code="detail-content". The script walks every [data-ms-field] descendant and populates each one based on its ms-field type. Default Values Whatever placeholder text or attribute value you put in the HTML stays visible until the script populates it. Use this as fallback content for fields that may be empty or null in the data — the script skips populating fields whose value is null or undefined. Potential Use Cases Any Memberstack-powered site that needs a per-record detail view as a navigation hub Task detail pages, project briefs, customer profiles, order summaries, content previews, member dashboards, and more Swap the table name and fields to match any data model — the script handles the rest