SDAIA

الإكمال التلقائي

الإكمال التلقائي provides a text input with live suggestion dropdown, supporting large and medium sizes across multiple interaction states.

جارٍ تحميل العرض التوضيحي: autocomplete-real-world

الإكمال التلقائي

Autocomplete provides a text input with live suggestion dropdown, supporting large and medium sizes across multiple interaction states.

التثبيت

npx sdaia-ui@latest add autocomplete

الاستخدام

الاستخدام

import { Autocomplete } from '@/components/ui/Autocomplete';
<Autocomplete size="large" placeholder="Search..." />

الأمثلة

الافتراضي

الإكمال التلقائي input in the default placeholder state.

جارٍ تحميل العرض التوضيحي: autocomplete-default

الأحجام

الإكمال التلقائي available in كبير and متوسط sizes.

جارٍ تحميل العرض التوضيحي: autocomplete-sizes

معطَّل

الإكمال التلقائي in the disabled state, preventing user interaction.

جارٍ تحميل العرض التوضيحي: autocomplete-disabled

مرجع الواجهة البرمجية

AutocompleteProps

خصائص مكوّن Autocomplete.

الخاصية

النوع

القيمة الافتراضية

مطلوبة

size

'large' | 'medium'

'large'

اختيارية

value

string

''

اختيارية

onChange

(value: string) => void

-

اختيارية

onSelect

(item: AutocompleteItem) => void

-

اختيارية

suggestions

AutocompleteItem[]

[]

اختيارية

suggestionsLabel

string

'Suggestions'

اختيارية

recents

AutocompleteItem[]

[]

اختيارية

recentsLabel

string

'Recents'

اختيارية

placeholder

string

'Search'

اختيارية

label

string

-

اختيارية

required

boolean

false

اختيارية

helperText

string

-

اختيارية

helperIcon

boolean

true

اختيارية

disabled

boolean

false

اختيارية

leadingIcon

boolean

true

اختيارية

id

string

-

اختيارية

onClear

() => void

—

اختيارية

labels

Partial<AutocompleteLabels>

English strings

اختيارية

السلوك المتجاوب

سلوك هذا المكوّن عند نقاط التوقف الثلاث المعتمدة. تتبدّل رموز المسافات والخطوط تلقائيًا عند 768px و1280px.

الشاشةالسلوك
الحاسوب (1280px فأكثر)بعرض الحاوية كاملًا. تُفتح قائمة الاقتراحات أسفل الحقل بالعرض نفسه وتتمرّر بعد 248px.
الجهاز اللوحي (768–1279px)التخطيط نفسه كما على الحاسوب، بقيم رموز الجهاز اللوحي.
الهاتف (أقل من 768px)السلوك نفسه بقيم رموز الهاتف. تُختصر الاقتراحات الطويلة.