@antadesign/anta
    Preparing search index...

    Interface SelectFacetedProps

    interface SelectFacetedProps {
        facets: SelectFacet[];
        placement?:
            | "left"
            | "right"
            | "bottom"
            | "top"
            | "bottom-start"
            | "bottom-end"
            | "top-start"
            | "top-end"
            | "right-start"
            | "right-end"
            | "left-start"
            | "left-end";
        offset?: number;
        value?: SelectFacetedValue;
        defaultValue?: SelectFacetedValue;
        onValueChange?: (
            value: SelectFacetedValue,
            attrs: SelectFacetedChangeAttrs,
        ) => void;
        label?: string;
        icon?: keyof IconShapes;
        size?: "small" | "medium" | "large";
        priority?: "primary" | "secondary";
        disabled?: boolean;
        tone?:
            | "neutral"
            | "brand"
            | "info"
            | "success"
            | "warning"
            | "critical"
            | string & {};
        toneScope?: ToneScope;
        searchable?: boolean;
        searchPlaceholder?: string;
        clearable?: boolean;
        clearAllLabel?: string;
        renderTrigger?: (state: SelectFacetedTriggerState) => ReactNode;
        className?: string;
        style?: CSSProperties;
        id?: string;
        title?: string;
        slot?: string;
        tabIndex?: number;
        key?: string | number | null;
        [key: `data-${string}`]: unknown;
        [key: `aria-${string}`]: unknown;
    }

    Hierarchy

    • Omit<BaseProps, "children">
      • SelectFacetedProps

    Indexable

    • [key: `data-${string}`]: unknown
    • [key: `aria-${string}`]: unknown
    Index
    facets: SelectFacet[]

    Categories to filter by. Each facet has a kind that determines its editor.

    placement?:
        | "left"
        | "right"
        | "bottom"
        | "top"
        | "bottom-start"
        | "bottom-end"
        | "top-start"
        | "top-end"
        | "right-start"
        | "right-end"
        | "left-start"
        | "left-end"

    Preferred placement of the root filter menu relative to its trigger. The menu auto-flips vertically and clamps horizontally when needed.

    bottom-start
    
    offset?: number

    Gap in pixels between the trigger and the filter menu.

    4
    

    Controlled value record, keyed by facet. When provided, update it through onValueChange. Leave it undefined for uncontrolled use; releasing control retains the latest applied record. Inline records work correctly. For a derived record, useMemo can avoid an extra component render when the parent renders with unchanged inputs. Pass records held in state directly.

     import { useMemo } from 'react'
    import { SelectFaceted, type SelectFacetedValue } from '@antadesign/anta'

    function StatusFilter({ status, onChange }: {
    status: string
    onChange: (value: SelectFacetedValue) => void
    }) {
    const value = useMemo(() => ({ status }), [status])
    return <SelectFaceted
    facets={[{ key: 'status', kind: 'single', label: 'Status',
    options: ['open', 'closed'] }]}
    value={value} onValueChange={onChange} />
    }
    defaultValue?: SelectFacetedValue

    Initial value for uncontrolled use.

    onValueChange?: (
        value: SelectFacetedValue,
        attrs: SelectFacetedChangeAttrs,
    ) => void

    Fires after any facet changes. value is the whole new record (a facet key → that facet's value; a cleared facet is absent). attrs says what changed: { facet, kind, value } for a single facet edit, or { all: true } for the "Clear all" row — narrow on 'all' in attrs before reading facet.

    label?: string

    Default trigger's button label.

    Filter
    
    icon?: keyof IconShapes

    Default trigger's leading icon.

    filter
    
    size?: "small" | "medium" | "large"

    Default trigger's button size.

    medium
    
    priority?: "primary" | "secondary"

    Default trigger's button priority.

    secondary
    
    disabled?: boolean

    Disable the whole control.

    tone?:
        | "neutral"
        | "brand"
        | "info"
        | "success"
        | "warning"
        | "critical"
        | string & {}

    Default option-row tone in facet flyouts. An option's own tone wins.

    toneScope?: ToneScope

    Apply the default row tone in every state, or only to selected rows. An option's own toneScope wins.

    'all'
    
    searchable?: boolean

    Adds a search field at the top of the root menu. It searches the options of every single and multiple facet in one list. For example, "alice" can appear under application-defined Assignee and Owner facets. text and custom facets remain available when the search is empty. Each facet uses its filter function when supplied, or the built-in substring match.

    searchPlaceholder?: string

    Placeholder for the global search field.

    Filter…
    
    clearable?: boolean

    Show the per-facet "Clear" row and the "Clear all" row.

    true
    
    clearAllLabel?: string

    Label for the "Clear all" row.

    Clear all
    
    renderTrigger?: (state: SelectFacetedTriggerState) => ReactNode

    Replaces the default Button with a trigger returned from this function. Receives a SelectFacetedTriggerState. Return exactly one focusable element: the menu is positioned relative to that element and opens when it is clicked. Add aria-haspopup={searchable ? 'dialog' : 'menu'} and aria-expanded={state.open} to the returned element, on a role that supports them (an Anta Button already carries role="button"; otherwise add role="combobox"). className, style, and other trigger props apply only to the default Button, so add styling and attributes to the returned element.

    className?: string

    Adds CSS classes to the root element and preserves its existing classes.

    style?: CSSProperties

    Inline CSS styles on the root element.

    id?: string

    HTML id attribute.

    title?: string

    HTML title attribute, shown as a browser tooltip on hover.

    slot?: string

    Named slot in a parent web component, such as slot="header" in a <Dialog>.

    tabIndex?: number

    Tab order. Set to -1 to skip the element when tabbing.

    key?: string | number | null

    React/Preact reconciliation key when rendered inside a list. Consumed by the JSX runtime (not forwarded as a DOM attribute).