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 | מחרוזת, אופציונלי | הכיוון של פס ההזזה. אחת מהאפשרויות הבאות:
horizontal או vertical. ברירת המחדל היא 'horizontal'. |
disabled | בוליאני, אופציונלי | האם המתג מושבת. ברירת המחדל היא False. |
style | אובייקט, אופציונלי | אובייקט של סגנונות CSS מותרים עם הערכים שיוגדרו לווידג'ט הזה. מידע נוסף זמין במסמכי התיעוד של הפונקציה style(). |
אלא אם צוין אחרת, התוכן של דף זה הוא ברישיון Creative Commons Attribution 4.0 ודוגמאות הקוד הן ברישיון Apache 2.0. לפרטים, ניתן לעיין במדיניות האתר Google Developers. Java הוא סימן מסחרי רשום של חברת Oracle ו/או של השותפים העצמאיים שלה.
עדכון אחרון: 2025-07-26 (שעון UTC).
[null,null,["עדכון אחרון: 2025-07-26 (שעון UTC)."],[[["\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. |"]]