ui.Slider
با مجموعهها، منظم بمانید
ذخیره و طبقهبندی محتوا براساس اولویتهای شما.
یک هدف قابل کشیدن که به صورت خطی بین دو مقدار عددی قرار دارد. مقدار لغزنده به عنوان یک برچسب در کنار آن نمایش داده می شود.
استفاده | برمی گرداند | ui.Slider( min , max , value , step , onChange , direction , disabled , style ) | ui.Slider |
استدلال | تایپ کنید | جزئیات | min | شماره، اختیاری | حداقل مقدار. پیشفرض 0 است. |
max | شماره، اختیاری | حداکثر مقدار. پیش فرض 1 است. |
value | شماره، اختیاری | مقدار اولیه پیشفرض 0 است. |
step | شماره، اختیاری | اندازه گام برای نوار لغزنده. پیشفرض 0.01 است. |
onChange | عملکرد، اختیاری | هنگامی که وضعیت لغزنده تغییر می کند، یک تماس برگشتی برای روشن شدن. تماس برگشتی به مقدار فعلی اسلایدر و ویجت لغزنده ارسال می شود. |
direction | رشته، اختیاری | جهت نوار لغزنده. یکی از «افقی» یا «عمودی». پیشفرض به «افقی» میرسد. |
disabled | بولی، اختیاری | اینکه آیا نوار لغزنده غیرفعال است. پیش فرض به نادرست. |
style | شیء، اختیاری | یک شی از سبک های CSS مجاز با مقادیر آنها برای تنظیم این ویجت. به مستندات style() مراجعه کنید. |
جز در مواردی که غیر از این ذکر شده باشد،محتوای این صفحه تحت مجوز Creative Commons Attribution 4.0 License است. نمونه کدها نیز دارای مجوز Apache 2.0 License است. برای اطلاع از جزئیات، به خطمشیهای سایت Google Developers مراجعه کنید. جاوا علامت تجاری ثبتشده Oracle و/یا شرکتهای وابسته به آن است.
تاریخ آخرین بهروزرسانی 2025-07-24 بهوقت ساعت هماهنگ جهانی.
[null,null,["تاریخ آخرین بهروزرسانی 2025-07-24 بهوقت ساعت هماهنگ جهانی."],[[["\u003cp\u003eThe \u003ccode\u003eui.Slider\u003c/code\u003e widget enables users to interactively select a numeric value within a defined range, visually represented by a draggable slider.\u003c/p\u003e\n"],["\u003cp\u003eIt offers customization options like minimum/maximum values, step size, initial value, orientation, and an onChange callback to respond to user interactions.\u003c/p\u003e\n"],["\u003cp\u003eDevelopers can further tailor its appearance using custom CSS styles through the \u003ccode\u003estyle\u003c/code\u003e argument.\u003c/p\u003e\n"]]],["The `ui.Slider` component creates a draggable slider between a minimum (`min`) and maximum (`max`) numeric value. It displays the current `value` with a label, adjustable by a defined `step`. The `direction` can be horizontal or vertical. An optional `onChange` function triggers on value changes, passing the current value. The slider can be `disabled`, and `style` properties are customizable. Default values are provided for `min`, `max`, `value`, and `step`.\n"],null,["# ui.Slider\n\n\u003cbr /\u003e\n\nA draggable target that ranges linearly between two numeric values. The value of the slider is displayed as a label alongside it.\n\n\u003cbr /\u003e\n\n| Usage | Returns |\n|-----------------------------------------------------------------------------------------------------------------|-----------|\n| `ui.Slider(`*min* `, `*max* `, `*value* `, `*step* `, `*onChange* `, `*direction* `, `*disabled* `, `*style*`)` | ui.Slider |\n\n| Argument | Type | Details |\n|-------------|--------------------|------------------------------------------------------------------------------------------------------------------------------|\n| `min` | Number, optional | The minimum value. Defaults to 0. |\n| `max` | Number, optional | The maximum value. Defaults to 1. |\n| `value` | Number, optional | The initial value. Defaults to 0. |\n| `step` | Number, optional | The step size for the slider. Defaults to 0.01. |\n| `onChange` | Function, optional | A callback to fire when the slider's state changes. The callback is passed the slider's current value and the slider widget. |\n| `direction` | String, optional | The direction of the slider. One of 'horizontal' or 'vertical'. Defaults to 'horizontal'. |\n| `disabled` | Boolean, optional | Whether the slider is disabled. Defaults to false. |\n| `style` | Object, optional | An object of allowed CSS styles with their values to be set for this widget. See style() documentation. |"]]