For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
Sign in
DocsAPI ReferenceChangelog
DocsAPI ReferenceChangelog
  • Get started
    • Quickstart
    • Concepts
  • Guides
    • Environments
  • Reference
        • Checkbox
        • Code
        • Color
        • Combobox
        • Group
        • Image
        • Font
        • Link
        • List
        • Number
        • Rich Text
        • Select
        • Slot
        • Style
        • Text Area
        • Text Input
      • Makeswift API Handler
    • Product docs
    • Blog
    • Support
Sign in
LogoLogo
On this page
  • Params
  • Prop type
  • Example
Reference@makeswift/runtimeControls

Number

Was this page helpful?
Previous

List

Next

RichText

Built with

Adds a Number input in the Makeswift builder to visually edit a number prop.

A Number panel on a Feed component to set the number of items shown

Params

label
stringDefaults to Number

Text for the panel label in the Makeswift builder.

description
string

The description shown in the Panel of the Makeswift builder. This can be written in Markdown format. Added in v0.24.8.

labelOrientation
"horizontal" | "vertical"Defaults to horizontal

Orientation of the number label within the panel.

defaultValue
number

The value passed to your component when nothing is set in the Makeswift builder.

min
number0

The smallest number that can be set in the panel input.

max
number0

The largest number that can be set in the panel input.

step
numberDefaults to 1

The increment amount when using the ↑ ↓ arrows or dragging the panel input.

suffix
string

Decorative text appended to the end of the panel input.

Prop type

The Number control passes a number to your component. If you don’t set a defaultValue and no value is set in the builder, your component receives undefined.

Example

1import { Number } from "@makeswift/runtime/controls";
2
3import { runtime } from "../../../../../makeswift/runtime";
4
5import { Feed } from "./Feed";
6
7runtime.registerComponent(Feed, {
8 type: "feed",
9 label: "Feed",
10 props: {
11 itemsShown: Number({
12 label: "Items shown",
13 defaultValue: 10,
14 min: 0,
15 max: 100,
16 }),
17 },
18});

.makeswift.ts is a naming convention for organizing Makeswift registration code. Learn more.