ui.Slider
Mit Sammlungen den Überblick behalten
Sie können Inhalte basierend auf Ihren Einstellungen speichern und kategorisieren.
Ein ziehbares Ziel, das linear zwischen zwei numerischen Werten liegt. Der Wert des Schiebereglers wird als Label daneben angezeigt.
Nutzung | Ausgabe |
---|
ui.Slider(min, max, value, step, onChange, direction, disabled, style) | ui.Slider |
Argument | Typ | Details |
---|
min | Nummer, optional | Der Mindestwert. Die Standardeinstellung ist 0. |
max | Nummer, optional | Der Höchstwert. Der Standardfaktor ist 1. |
value | Nummer, optional | Der Anfangswert. Die Standardeinstellung ist 0. |
step | Nummer, optional | Die Schrittweite für den Schieberegler. Der Standardwert ist 0,01. |
onChange | Funktion (optional) | Ein Callback, der ausgelöst wird, wenn sich der Status des Schiebereglers ändert. An den Callback werden der aktuelle Wert des Schiebereglers und das Schieberegler-Widget übergeben. |
direction | String, optional | Die Richtung des Schiebereglers. Entweder „horizontal“ oder „vertical“. Die Standardeinstellung ist „horizontal“. |
disabled | Boolesch, optional | Gibt an, ob der Schieberegler deaktiviert ist. Die Standardeinstellung ist "false". |
style | Objekt, optional | Ein Objekt mit zulässigen CSS-Stilen und den Werten, die für dieses Widget festgelegt werden sollen. Weitere Informationen finden Sie in der Dokumentation zu style(). |
Sofern nicht anders angegeben, sind die Inhalte dieser Seite unter der Creative Commons Attribution 4.0 License und Codebeispiele unter der Apache 2.0 License lizenziert. Weitere Informationen finden Sie in den Websiterichtlinien von Google Developers. Java ist eine eingetragene Marke von Oracle und/oder seinen Partnern.
Zuletzt aktualisiert: 2025-07-26 (UTC).
[null,null,["Zuletzt aktualisiert: 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. |"]]