لوح تصفية

Filtration

لوحة مرشّحات متعدّدة الأوجه في React، منبثقة أو مضمّنة، بأقسام ومرشّحات مربّعات اختيار وعدّاد نتائج وزرَي تطبيق ومسح. تبقى الحالة في كودك.

تفتح Filtration لوحة أقسام تصفية يغلقها زرا التطبيق والمسح. الحالة ملكك: كل قسم يغلف عنصرًا خاضعًا للتحكم.

متى تستخدمه

استخدم Filtration فوق نتائج البحث والجداول وأدلّة الخدمات حين يجمع المستخدم عدّة معايير: الحالة والمنطقة والتاريخ والفئة. اجمع التغييرات وطبّقها معًا حتى لا تقفز النتائج بعد كل نقرة.

استخدم اللوحة المضمّنة في الشاشات العريضة والمنبثقة في الجوال. لمرشّح واحد يكفي Select أو صف من Chip.

أمثلة

تصفية منبثقة (مُتحكَّم بها)

لوح مضمّن

الخصائص

الخصائص التي يعرّفها Filtration. سمات العنصر الأصلي تمرّ كما هي.

<Filtration>

الخاصيةالنوعالافتراضيالوصف
overlaybooleanFloating overlay anchored to the trigger (default) vs an embedded inline panel.
openbooleanControlled open state (overlay only).
defaultOpenbooleanUncontrolled initial open state (overlay only).
onOpenChange(open: boolean) => void
childrenreact.ReactNode

<FiltrationTrigger>

الخاصيةالنوعالافتراضيالوصف
size"sm" | "md" | "lg" | "icon" | "icon-md" | "icon-sm" | "icon-xs"
fullWidthboolean
onColorboolean
loadingboolean
startIconreact.ReactNodeLeading icon. For an icon-only button pass the glyph as children with an icon size and an aria-label.
endIconreact.ReactNode
iconFlipbooleanFlip start/end icons horizontally in RTL (for chevrons, arrows, etc.)

<FiltrationResults>

الخاصيةالنوعالافتراضيالوصف
aria-labelstringNames the applied-filters chip group for assistive tech, e.g. "Applied filters".

<FiltrationPanel>

الخاصيةالنوعالافتراضيالوصف
deferPointerDownOutsidebooleanWhen true, a 'pointerdown' event outside of the layered element will wait for the interaction's click event before dispatching, allowing third-party code to stop propagation of later events and cancel dismissal.
onEscapeKeyDown(event: KeyboardEvent) => voidEvent handler called when the escape key is down. Can be prevented.
onPointerDownOutside(event: PointerDownOutsideEvent) => voidEvent handler called when the a pointerdown event happens outside of the DismissableLayer. Can be prevented.
onFocusOutside(event: FocusOutsideEvent) => voidEvent handler called when the focus moves outside of the DismissableLayer. Can be prevented.
onInteractOutside(event: PointerDownOutsideEvent | FocusOutsideEvent) => voidEvent handler called when an interaction happens outside the DismissableLayer. Specifically, when a pointerdown event happens outside or focus moves outside of it. Can be prevented.
forceMounttrueUsed to force mounting when more control is needed. Useful when controlling animation with React animation libraries.
onOpenAutoFocus(event: Event) => voidEvent handler called when auto-focusing on open. Can be prevented.
onCloseAutoFocus(event: Event) => voidEvent handler called when auto-focusing on close. Can be prevented.
side"top" | "right" | "bottom" | "left"
sideOffsetnumber
align"center" | "start" | "end"
alignOffsetnumber
arrowPaddingnumber
avoidCollisionsboolean
collisionBoundaryElement | Element[]
collisionPaddingnumber | Partial<Record<"top" | "right" | "bottom" | "left", number>>
sticky"always" | "partial"
hideWhenDetachedboolean
updatePositionStrategy"always" | "optimized"

<FiltrationCheckboxFilter>

الخاصيةالنوعالافتراضيالوصف
optionsإلزاميFiltrationCheckboxOption[]
valuestring[]Controlled selected values.
defaultValuestring[]Uncontrolled initial selected values.
onValueChange(next: string[]) => void
searchablebooleanShow a search field that filters options by label.
searchPlaceholderstring
searchLabelstringAccessible label for the search field (it has no visible label).
collapseAfternumberCollapse to the first N options behind a "Show more" toggle.
showMoreLabel(remaining: number) => ReactNodeMaps the hidden-count → the expand button label. Default Show {n} more.
showLessLabelreact.ReactNode
aria-labelstringDefines a string value that labels the current element.
aria-labelledbystringIdentifies the element (or elements) that labels the current element.
classNamestring

<FiltrationOptionList>

الخاصيةالنوعالافتراضيالوصف
namestring
formstring
requiredboolean
disabledboolean
dirDirection
orientation"vertical" | "horizontal"
loopboolean
defaultValuestring
valuestring
onValueChange(value: string) => void

<FiltrationOption>

الخاصيةالنوعالافتراضيالوصف
childrenإلزاميreact.ReactNode
asChildboolean
checkedboolean
requiredboolean
valueإلزاميstring

<FiltrationFooter>

الخاصيةالنوعالافتراضيالوصف
applyLabelreact.ReactNode
clearLabelreact.ReactNode
appliedCountnumberAppended to the apply label as (n).
onApply() => void
onClear() => void
closeOnApplybooleanClose the overlay when Apply is pressed (overlay only). Default true.

إمكانية الوصول

كل قسم role="group" مسمّى بعنوانه، ويعرض مشغّل اللوحة المنبثقة aria-expanded وaria-controls. المرشّحات داخلها مربّعات اختيار وحقول حقيقية بتسميات.

زرا التطبيق والمسح زران، وعدّاد النتائج نص فيقرأ قارئ الشاشة عدد المطابقات المتبقّية.