@1upvision/sdk.
Layout
Box, CompactView, List, VStack, HStack
Display
Text, Image
Inputs
Button, Toggle, TextField, Dropdown, and more
Custom Styling
All components accept an optionalstyle prop of type VisionStyle. This is a typed subset of CSS properties that gets sanitized by the host before rendering as inline styles.
Fonts
The SDK supports two font-loading paths for extensions:- Google Fonts via
vision.config.json
- Local fonts via
localFont()
public/ directory.
They are copied into dist/ automatically by the CLI.
Supported Properties
| Category | Properties |
|---|---|
| Layout | display, flexDirection, flexWrap, alignItems, justifyContent, alignSelf, gap, flex, flexGrow, flexShrink, flexBasis, gridTemplateColumns, gridTemplateRows, gridColumn, gridRow, gridGap |
| Position | position ("relative" or "absolute" only), top, right, bottom, left, zIndex |
| Sizing | width, height, minWidth, maxWidth, minHeight, maxHeight, aspectRatio |
| Spacing | padding, paddingTop/Right/Bottom/Left, margin, marginTop/Right/Bottom/Left |
| Colors | color, backgroundColor, background, opacity |
| Border | border, borderWidth, borderColor, borderStyle, borderRadius, borderTop/Right/Bottom/Left |
| Typography | fontSize, fontWeight, fontFamily, fontStyle, textAlign, textDecoration, textTransform, lineHeight, letterSpacing, whiteSpace, overflow, textOverflow, wordBreak |
| Transform & Animation | transform, transformOrigin, transition, animation, animationName, animationDuration, animationTimingFunction, animationDelay, animationIterationCount, animationDirection, animationFillMode, animationPlayState |
| Effects | boxShadow, textShadow, filter, backdropFilter |
| Other | objectFit, pointerEvents, userSelect, cursor, overflowX, overflowY |
Security Restrictions
For security, the following are blocked by the host sanitizer:position: "fixed"andposition: "sticky"— only"relative"and"absolute"are allowedurl()values in component styles — uselocalFont()for fonts and<Image>for imagesexpression(),javascript:,@import, and other injection vectors
Keyframe Animations
UsedefineKeyframes to create CSS @keyframes animations. Define keyframes at module scope and reference them in animation or animationName style properties.
from, to, or percentage values like 0%, 50%, 100%. Each stop accepts the same VisionStyle properties. The host sanitizes all keyframe values using the same security rules as inline styles.
Overlay Example
Build a custom scoreboard overlay usingBox and styled components:
Behavior by Target
Components behave differently depending on where they render:| Component | Editor | Interactive | OBS Layer |
|---|---|---|---|
| CompactView | Container | Container | Container |
| List | Container | Container | Container |
| Box | Container | Container | Container |
| VStack | Container | Container | Container |
| HStack | Container | Container | Container |
| Text | Text | Text | Text |
| Image | Image | Image | Image |
| Button | Interactive | Interactive | Hidden |
| TextField | Editable | Editable | Shows value as text |
| TextArea | Editable | Editable | Shows value as text |
| NumberField | Editable | Editable | Shows value as text |
| Toggle | Interactive | Interactive | Shows “On” / “Off” |
| Dropdown | Interactive | Interactive | Shows selected label |