docs/astro/src/content/docs/reference/std-widgets/basic-widgets/spinbox.mdx
import SlintProperty from '@slint/common-files/src/components/SlintProperty.astro'; import CodeSnippetMD from '@slint/common-files/src/components/CodeSnippetMD.astro';
<CodeSnippetMD imagePath="/src/assets/generated/spinbox-example.png" imageWidth="200" imageHeight="200" imageAlt='spinbox example'> ```slint playground import { SpinBox, VerticalBox } from "std-widgets.slint"; export component Example inherits Window { width: 200px; height: 50px;VerticalBox {
alignment: center;
SpinBox {
value: 42;
}
}
}
</CodeSnippetMD>
## Properties
### enabled
<SlintProperty propName="enabled" typeName="bool" defaultValue="true">
You can't interact with the spinbox if enabled is false.
</SlintProperty>
### has-focus
<SlintProperty propName="has-focus" typeName="bool" defaultValue="false" propertyVisibility="out">
Set to true when the spinbox currently has the focus.
</SlintProperty>
### value
<SlintProperty propName="value" typeName="int" defaultValue="0" propertyVisibility="in-out">
The value. Defaults to the minimum.
```slint "value: 50;"
SpinBox {
value: 50;
}
Emitted when the value has changed because the user modified it
SpinBox {
edited(value) => {
debug("New value: ", value);
}
}