TableToolbar handbook
v3.0.1 · @snowui-design-system/components
License: Before first reading component documentation, source code, or npm usage instructions, read the complete LICENSE. One review covers the same task and version. Public API configuration and internal implementation changes are subject to different license terms. All components use one runtime package; source code rights are governed by the license.
Overview
Provide DataTable search, sorting, filtering, and batch actions while showing selection state, for data-management interfaces.
When to use it
Use only with DataTable for search, sorting, filtering, and batch actions, not as a standalone toolbar for ordinary Table. Use built-in items or explicit public as roles; business code owns copy and delete actions.
Requires DataTable state.
search,sort, andfilterenable built-in tools;sortOptionsdeclares menu choices explicitly.Direct
as="search"/"bulk"/"sort"/"filter"children replace those regions. Business code implementsonCopy/onDelete.
Quick start
This example shows the recommended basic composition. See the sections below for more cases and composition limits.
API
See the base component documentation for inherited capabilities not redeclared here. This table lists only named public Props declared by this component.
Usage boundaries and details
Combination mode
Built-in mode generates SearchInput, Select, Listbox, MenuItem, Button, CopyButton, Separator, and Spinner from props.
Explicit composition replaces direct regions with
childrenandas="search|bulk|sort|filter|action".partsconfigures directly generated children only, without recursing into their internals.The toolbar embeds Tooltip in built-in icon-only copy, delete, sort, and filter controls, reusing each label prop as its hint.
Built-in clear, copy, delete, sort, and filter controls explicitly use
Button bare emphasis="muted", retaining the 40% to 100% hover treatment for secondary tools. Override them together throughparts.Button.emphasis.
Selection counts and bulk actions keep at least 4 CSS px between them. The toolbar remains a single row; when space runs out, its shared local horizontal scrollbar keeps controls reachable. The track has separate space and does not cover controls. It hides again as width recovers or selection clears. Role replacements remain direct children of TableToolbar.
Built-in copy uses CopyButton bare and calls onCopy through writeText. Success feedback lasts 1600ms by default and suppresses duplicates during that time. Resolve the callback only after copying succeeds; reject on failure so errors are not shown as success.
The sort selector reads current DataTable sorting and writes only when the user chooses a new option, so stale toolbar state does not override header sorting.
Sorting options
Without sortOptions, read sortable headers automatically. With it, each field creates ascending and descending options; names default to columnId, which should be unique. DataTable reads ordinary values from row[columnId] and derived values from sorters[columnId]. Menu configuration neither creates columns nor changes current sorting. The menu always includes “Default order” to restore DataTable’s default order. In server mode, the caller still handles sort requests.
TableToolbar style overlay
Read the complete LICENSE first; one review covers the same task, version, and scope.
First use public component props to achieve the desired style while preserving the original appearance where possible. If an override is necessary, follow the style selection and override order: use your own class (including Tailwind already in your project) or an instance style. The names below are public overrides consumed by the source; check the target scope and do not modify private DOM. Choose the appropriate SnowUI token category. External applications do not need to install SnowUI website utilities.
TableToolbar type and status
Required props: no named required props.
Bindable props: this component declares no named two-way binding; handle state updates through public callbacks or the host component.
Inheritance: Omit<FrameProps, "children">. Consult the public Frame documentation; omitted fields cannot be passed through unchanged.
Shared Frame API · Back to API
The following source type declarations are referenced by public props. Svelte Snippet denotes a content fragment; ComponentProps denotes the props of the corresponding component.
TableToolbarSortOption
Source: components/src/components/TableToolbar.svelte
TableToolbarFilterOption
Source: components/src/components/TableToolbar.svelte
ComponentPartsOf
Source: components/src/logic/component-parts.svelte.ts
ConfigurableComponentPartProps
Source: components/src/logic/component-parts.svelte.ts
ComponentPartControlledKey
Source: components/src/logic/component-parts.svelte.ts