Skip to main content

Input Components

Input components are fully interactive on the editor surface. On the layer surface, they automatically render in a read-only display mode.

Button​

A clickable action button.

Props​

PropTypeRequiredDescription
labelstringYesButton text
onClick() => voidYesClick handler
variant"default" | "destructive"NoVisual variant (default: "default")
disabledbooleanNoPrevents clicks and shows disabled state
styleVisionStyleNoAdditional style

Layer behavior: Not rendered (hidden entirely).

Example​

import { Button, useMutation } from "@zaflun/lumio-sdk";

function ActionBar() {
const { mutate: resetScores, isLoading } = useMutation("resetScores");

return (
<>
<Button
label="Update scores"
onClick={() => {/* ... */}}
/>
<Button
label="Reset all"
variant="destructive"
onClick={() => resetScores()}
disabled={isLoading}
/>
</>
);
}

Toggle​

A boolean on/off switch with a label.

Props​

PropTypeRequiredDescription
labelstringYesLabel text
checkedbooleanYesCurrent state
onChange(checked: boolean) => voidYesChange handler
disabledbooleanNoPrevents interaction
styleVisionStyleNoAdditional style

Layer behavior: Shows "On" or "Off" as plain text.

Example​

import { Toggle, useExtensionStorage } from "@zaflun/lumio-sdk";

function VisibilityToggle() {
const [visible, setVisible] = useExtensionStorage("visible", true);

return (
<Toggle
label="Show overlay"
checked={visible}
onChange={setVisible}
/>
);
}

TextField​

A single-line text input.

Props​

PropTypeRequiredDescription
labelstringYesInput label
valuestringYesCurrent value
onChange(value: string) => voidYesChange handler
placeholderstringNoPlaceholder text
disabledbooleanNoMakes the field non-editable
styleVisionStyleNoAdditional style

Layer behavior: Shows current value as plain text.

Example​

import { TextField, useExtensionStorage } from "@zaflun/lumio-sdk";

function TeamInput() {
const [homeTeam, setHomeTeam] = useExtensionStorage("homeTeam", "");

return (
<TextField
label="Home team"
value={homeTeam}
placeholder="Enter team name"
onChange={setHomeTeam}
/>
);
}

TextArea​

A multi-line text input.

Props​

PropTypeRequiredDescription
labelstringYesInput label
valuestringYesCurrent value
onChange(value: string) => voidYesChange handler
placeholderstringNoPlaceholder text
rowsnumberNoNumber of visible rows (default: 3)
disabledbooleanNoMakes the field non-editable
styleVisionStyleNoAdditional style

Layer behavior: Shows current value as plain text.

Example​

import { TextArea, useExtensionStorage } from "@zaflun/lumio-sdk";

function NotesInput() {
const [notes, setNotes] = useExtensionStorage("notes", "");

return (
<TextArea
label="Stream notes"
value={notes}
placeholder="Add notes for your stream..."
rows={4}
onChange={setNotes}
/>
);
}

NumberField​

A numeric input with increment/decrement buttons.

Props​

PropTypeRequiredDescription
labelstringYesInput label
valuenumberYesCurrent value
onChange(value: number) => voidYesChange handler
minnumberNoMinimum value
maxnumberNoMaximum value
stepnumberNoIncrement step (default: 1)
disabledbooleanNoMakes the field non-editable
styleVisionStyleNoAdditional style

Layer behavior: Shows current value as plain text.

Example​

import { NumberField, useExtensionStorage } from "@zaflun/lumio-sdk";

function ScoreInput() {
const [homeScore, setHomeScore] = useExtensionStorage("homeScore", 0);

return (
<NumberField
label="Home score"
value={homeScore}
min={0}
max={99}
onChange={setHomeScore}
/>
);
}

A select input with a list of options.

Props​

PropTypeRequiredDescription
labelstringYesInput label
valuestringYesCurrently selected value
options{ value: string; label: string }[]YesAvailable options
onChange(value: string) => voidYesChange handler
disabledbooleanNoPrevents selection
styleVisionStyleNoAdditional style

Layer behavior: Shows the selected option's label as plain text.

Example​

import { Dropdown, useExtensionStorage } from "@zaflun/lumio-sdk";

function PositionSelector() {
const [position, setPosition] = useExtensionStorage("position", "top-right");

return (
<Dropdown
label="Position"
value={position}
options={[
{ value: "top-left", label: "Top left" },
{ value: "top-right", label: "Top right" },
{ value: "bottom-left", label: "Bottom left" },
{ value: "bottom-right", label: "Bottom right" },
]}
onChange={setPosition}
/>
);
}

Slider​

A range input for selecting a numeric value within a range.

Props​

PropTypeRequiredDescription
labelstringYesInput label
valuenumberYesCurrent value
minnumberYesMinimum value
maxnumberYesMaximum value
onChange(value: number) => voidYesChange handler
stepnumberNoIncrement step (default: 1)
showValuebooleanNoShow current value next to label (default: true)
disabledbooleanNoPrevents interaction
styleVisionStyleNoAdditional style

Layer behavior: Shows current numeric value as plain text.

Example​

import { Slider, useExtensionStorage } from "@zaflun/lumio-sdk";

function OpacitySlider() {
const [opacity, setOpacity] = useExtensionStorage("opacity", 100);

return (
<Slider
label="Opacity"
value={opacity}
min={0}
max={100}
step={5}
onChange={setOpacity}
/>
);
}