Skip to main content

NumberSequencePicker

An interface for modifying NumberSequence values. This closely resembles the built-in NumberSequence picker for editing properties, with minor adjustments for improved readability.

Dark Light
Dark Light

As this is a controlled component, you should pass a NumberSequence to the Value prop representing the current value, and a callback to the OnChanged prop which gets run when the user attempts to change the sequence using the interface. For example:

local function MyComponent()
	local sequence, setSequence = React.useState(NumberSequence.new(...))
	return React.createElement(StudioComponents.NumberSequencePicker, {
		Value = sequence,
		OnChanged = setSequence,
	})
end

The default size of this component is exposed in Constants.DefaultNumberSequencePickerSize. To keep all inputs accessible, it is recommended not to use a smaller size than this.

Types

Props

Component Props
interface Props {
OnChanged((newValueNumberSequence) → ())?
}
Show raw api
{
    "functions": [],
    "properties": [],
    "types": [
        {
            "name": "Props",
            "desc": "",
            "fields": [
                {
                    "name": "...",
                    "lua_type": "CommonProps",
                    "desc": ""
                },
                {
                    "name": "Value",
                    "lua_type": "NumberSequence",
                    "desc": ""
                },
                {
                    "name": "OnChanged",
                    "lua_type": "((newValue: NumberSequence) -> ())?",
                    "desc": ""
                }
            ],
            "tags": [
                "Component Props"
            ],
            "source": {
                "line": 58,
                "path": "src/Components/NumberSequencePicker/init.luau"
            }
        }
    ],
    "name": "NumberSequencePicker",
    "desc": "An interface for modifying [NumberSequence](https://create.roblox.com/docs/reference/engine/datatypes/NumberSequence) values.\nThis closely resembles the built-in NumberSequence picker for editing properties, with minor adjustments\nfor improved readability.\n\n| Dark | Light |\n| - | - |\n| ![Dark](/StudioComponents/components/numbersequencepicker/dark.png) | ![Light](/StudioComponents/components/numbersequencepicker/light.png) |\n\nAs this is a controlled component, you should pass a NumberSequence to the `Value` prop \nrepresenting the current value, and a callback to the `OnChanged` prop which gets run when the \nuser attempts to change the sequence using the interface. For example:\n\n```lua\nlocal function MyComponent()\n\tlocal sequence, setSequence = React.useState(NumberSequence.new(...))\n\treturn React.createElement(StudioComponents.NumberSequencePicker, {\n\t\tValue = sequence,\n\t\tOnChanged = setSequence,\n\t})\nend\n```\n\nThe default size of this component is exposed in [Constants.DefaultNumberSequencePickerSize].\nTo keep all inputs accessible, it is recommended not to use a smaller size than this.",
    "source": {
        "line": 29,
        "path": "src/Components/NumberSequencePicker/init.luau"
    }
}