FusedNumber
export function MyComponent({
radius = 50,
topLeft,
topRight,
bottomRight,
bottomLeft,
isMixed = false,
}) {
const borderRadius = isMixed
? `${topLeft}px ${topRight}px ${bottomRight}px ${bottomLeft}px`
: `${radius}px`
return <Frame background={"red"} borderRadius={borderRadius} size={"100%"}></Frame>
}
addPropertyControls(MyComponent, {
radius: {
type: ControlType.FusedNumber,
title: "Radius",
defaultValue: 50,
toggleKey: "isMixed",
toggleTitles: ["All", "Individual"],
valueKeys: ["topLeft", "topRight", "bottomRight", "bottomLeft"],
valueLabels: ["NW", "NE", "SE", "SW"],
min: 0,
},
})Last updated