enes

Exported components

  • LiteFilter
  • LiteFilterItem

LiteFilter AI

A LiteFilter is a row of pills that filters content, such as search results. When the pills do not fit, the row scrolls and an arrow shows on each side that hides pills.

All Apps Documents Web People IMG JPG

Usage

<script>
  import { LiteFilter, LiteFilterItem } from 'fluentui-svelte';
  let filter = $state('all');
</script>

<LiteFilter aria-label="Search filters" bind:selectedValue={filter}>
  <LiteFilterItem value="all">All</LiteFilterItem>
  <LiteFilterItem value="apps">Apps</LiteFilterItem>
  <LiteFilterItem value="documents">Documents</LiteFilterItem>
</LiteFilter>

Overflow

Give the filter a width, or a container with one. The arrows show only toward the hidden pills: none when every pill fits, then the next arrow, both in the middle and the previous arrow at the end.

All Apps Documents Web People IMG JPG Gif iCloud OneDrive SkyDrive Pictures Songs Videos
Selected: all

Filtering results

One pill is selected at a time, like a radio group. Bind selectedValue and filter the content with it. size and appearance style every pill.

All Apps Documents Web People
  • Budget 2026.xlsx
  • Fluent UI
  • Calculator
  • Ada Lovelace
  • Notes.docx
  • Svelte docs

Multiple selection

multiple lets several pills be selected, and none: selectedValue becomes an array. Each item takes an icon and disabled.

Apps Documents Web People Images
Selected: documents

Forms and labels

Wrap the filter in a Label to give it a visible name: the Label names the whole group, which then needs no aria-label. With name, the selection submits with the form: one value for a single filter, one entry per selected pill with multiple. Outside the form, point form at its id.

All Documents Pictures
This PC OneDrive SharePoint
Submitted: nothing yet

Keyboard and accessibility

The filter is a radiogroup of radios, or a group of checkboxes with multiple. Tab moves through the pills and scrolls the focused one into view, Space selects. The arrows stay off the tab order. Name the filter with a Label around it or aria-label, and localize previousLabel and nextLabel.

Component Props

LiteFilter

NameTypeDefaultDescription
ref bindableHTMLDivElement | nullThe DOM reference of the root element.
selectedValue bindablestring | string[]The value of the selected item, or the values of the selected items when multiple is set.
multiplebooleanLets more than one item be selected, and none. A selection kept across a change of mode takes the new shape: the first value, or an array.
namestringThe field name shared by every item.
formstringThe id of the form that owns the items, when outside that form.
disabledbooleanDisables every item.
size'small' | 'medium' | 'large' | 'extra-large''medium'The height and text size of the pills.
appearance'filled' | 'outline' | 'brand''filled'The appearance of the pills.
onSelectionChange(event: Event, value: string | string[]) => voidFired when user interaction changes the selection.
previousLabelstring'Scroll back'Accessible name of the button that scrolls back.
nextLabelstring'Scroll forward'Accessible name of the button that scrolls forward.
disableTabspotbooleanDisables tabspot keyboard navigation.
childrenSnippetThe items of the filter.
HTMLAttributes<HTMLDivElement> without children

LiteFilterItem

NameTypeDefaultDescription
ref bindableHTMLInputElement | nullThe DOM reference of the native input.
valuestringA unique value identifying this item within its filter.
iconSnippet<[SVGAttributes<SVGElement>]> | Component<SVGAttributes<SVGElement>>An optional decorative Fluent icon before the label.
disabledbooleanDisables this item.
childrenSnippetThe label of the item.

Support Fluent UI Svelte

The library is built by one person in their free time. If it helps your work, consider sponsoring it.