Once UI Handbook
Beginner Guides
What is Once UI?
Install & config
Page skeleton
Your first page
Build And Launch
How to launch a portfolio site that actually gets you hired
How to build a documentation site with MDX and Next.js
How to ship a landing page and dashboard with authentication in Next.js
How to launch a social app with Next.js and Supabase
Vibe Coding
Introduction to vibe coding
Set up your local dev environment
Essential tools for vibe coding
Build your first Once UI app
Common Patterns
Hero section
Static panel
Form layout
Highlighted card
Responsive stacking
Decoration layers
Dialog & modal
Toast & feedback
Tables & lists
Loading states
App shell navigation
Dashboard & charts
Chat & messaging
Auth & verification
Settings & split panels
Data filters & toolbar
Command palette
Pricing & plans
Accordion & FAQ
Media & uploads
Empty & error states
SEO, Open Graph, and structured data
Documentation code blocks with live preview
Carousels, galleries, and before/after comparisons
Date pickers and scheduling
Context menus and dropdown actions
Tags, chips, and multi-value inputs
Roadmap & kanban
Form inputs & controls
Progress, status & badges
Scrolling & feeds
Profile, avatars & identity
Social proof & logo clouds
Masonry & media grids
Table pagination, search & bulk selection
Banners & announcements
Footer layouts
Onboarding & first run
Waitlist & coming soon
Design Tips
Color & surfaces
Harness overview
Row, Column & Grid
Spacing & rhythm
Icons & buttons
Reveal & motion
Theme tokens, FOUC-free init, and runtime style controls
Tooltips and hover cards
Block updates
Block updates changelog
Agent Resources
Column, not Flex
Semantics over CSS
Typography scale
Common gotchas
Block anchors
Validate generated code
Pro block registry
Match task bundles
TrademarkTrademark
Ctrl k
Search...
Sign up
Once UI Handbook
Beginner Guides
What is Once UI?
Install & config
Page skeleton
Your first page
Build And Launch
How to launch a portfolio site that actually gets you hired
How to build a documentation site with MDX and Next.js
How to ship a landing page and dashboard with authentication in Next.js
How to launch a social app with Next.js and Supabase
Vibe Coding
Introduction to vibe coding
Set up your local dev environment
Essential tools for vibe coding
Build your first Once UI app
Common Patterns
Hero section
Static panel
Form layout
Highlighted card
Responsive stacking
Decoration layers
Dialog & modal
Toast & feedback
Tables & lists
Loading states
App shell navigation
Dashboard & charts
Chat & messaging
Auth & verification
Settings & split panels
Data filters & toolbar
Command palette
Pricing & plans
Accordion & FAQ
Media & uploads
Empty & error states
SEO, Open Graph, and structured data
Documentation code blocks with live preview
Carousels, galleries, and before/after comparisons
Date pickers and scheduling
Context menus and dropdown actions
Tags, chips, and multi-value inputs
Roadmap & kanban
Form inputs & controls
Progress, status & badges
Scrolling & feeds
Profile, avatars & identity
Social proof & logo clouds
Masonry & media grids
Table pagination, search & bulk selection
Banners & announcements
Footer layouts
Onboarding & first run
Waitlist & coming soon
Design Tips
Color & surfaces
Harness overview
Row, Column & Grid
Spacing & rhythm
Icons & buttons
Reveal & motion
Theme tokens, FOUC-free init, and runtime style controls
Tooltips and hover cards
Block updates
Block updates changelog
Agent Resources
Column, not Flex
Semantics over CSS
Typography scale
Common gotchas
Block anchors
Validate generated code
Pro block registry
Match task bundles
TrademarkTrademark
Once UIDocumentationBlog
© Once UI. All rights reserved.
Built with Aveiro

Data filters & toolbar

Compose table toolbars with search, SegmentedControl view switchers, date ranges, and filter chips.
Updated 19d ago
Settings & split panels
Command palette
6 min · Pattern
Data tables need a toolbar above the rows — search, view switcher, date range, and active filter chips. Compose these with Row, SegmentedControl, and Input.

What this pattern covers

A data table is more than columns and rows. Production tables almost always need:
  • A heading or selection count on the left
  • Search input on the right
  • SegmentedControl to switch views (All / Active / Archived)
  • DateRangePicker for time-bounded data
  • Active filter Tags the user can dismiss
Gold reference: packages/core/ai/examples/blocks/Table1.tsx and eval task #9 in packages/core/ai/eval-tasks.md.

Toolbar anatomy

The toolbar is a Row with horizontal="between" and responsive stacking:
<Row
  fillWidth
  horizontal="between"
  vertical="center"
  paddingY="12"
  paddingX="24"
  gap="16"
  s={{ direction: "column", horizontal: "start" }}
>
  <Text variant="label-default-m">Transactions</Text>
  <Row gap="12" vertical="center">
    {/* filters go here */}
  </Row>
</Row>
On mobile (s={{ direction: "column" }}), stack the heading above the filter controls.

Search input

Table search uses Input with a search icon prefix and optional clear suffix:
<Input
  height="s"
  id="search"
  placeholder="Search..."
  value={search}
  hasPrefix={<Icon name="search" size="s" onBackground="neutral-weak" />}
  hasSuffix={
    search.length > 0 && (
      <IconButton
        tooltip="Clear"
        icon="close"
        size="s"
        variant="ghost"
        onClick={() => setSearch("")}
      />
    )
  }
/>
Wire value and onChange to local state. Reset pagination to page 1 when the query changes.

View switcher with SegmentedControl

Use SegmentedControl for mutually exclusive views:
const views = [
  { value: "all", label: "All" },
  { value: "active", label: "Active" },
  { value: "archived", label: "Archived" },
];

<SegmentedControl
  buttons={views}
  selected={view}
  onToggle={(value) => setView(value)}
/>
Controlled mode: own selected state and update it in onToggle. This same pattern appears on pricing pages for monthly/yearly billing toggles.

Date range filter

DateRangePicker sits in the toolbar for time-bounded tables. Pass value (a { from, to } range object) and onChange to update filter state. For compact toolbars, wrap DateRangePicker in a — it renders as an Input that opens the picker in a dropdown.
DateRangeInput
Filter logic: when a range is set, include only rows whose date field falls within from–to. Clear the range when the user picks "All time."

Active filter chips

Show applied filters as dismissible Tags below the toolbar:
Each Tag should have a click handler or close affordance to remove that filter and refresh the table.

Wiring filters to data

Keep filter state in the parent and derive rows with useMemo:
  • Start with the full dataset
  • Apply view filter (active/archived)
  • Apply date range filter
  • Apply search query (use a custom filterFn for field-specific matching)
  • Paginate the result
Reference Table1's filterFn prop for custom search logic instead of JSON.stringify fallback.

Selection count

When rows are selectable, replace the heading with a count:
Show bulk actions (Delete, Export) in the toolbar only when selectedCount > 0.

Write this / not this

✅ Once UI way
❌ Common mistake
SegmentedControl for view tabsCustom button group with manual active styles
Input `height="s"` in toolbarFull-size Input breaking toolbar height
`useMemo` for derived rowsFiltering inside render without memoization
Tag chips for active filtersNo indication of applied filters
Reset page on filter changeStale page 5 with 0 results

Check yourself

  • Toolbar stacks vertically on mobile
  • Search has clear button when query is non-empty
  • SegmentedControl is controlled (selected + onToggle)
  • Date range clears properly
  • Pagination resets when any filter changes

Related

→ Tables & lists → Loading states → Dashboard & charts → Full reference: docs.once-ui.com — SegmentedControl
<Row gap="8" wrap paddingX="24" paddingBottom="12">
  <Tag variant="neutral" prefixIcon="calendar">
    Last 30 days
  </Tag>
  <Tag variant="neutral" prefixIcon="filter">
    Status: Active
  </Tag>
</Row>
<Text variant="label-default-m">{selectedCount} selected</Text>