MCPcopy Create free account
hub / github.com/adobe/react-spectrum / SizeControl

Function SizeControl

packages/dev/s2-docs/src/VisualExampleClient.tsx:1599–1622  ·  view source on GitHub ↗
({control, value, onChange}: ControlProps)

Source from the content-addressed store, hash-verified

1597}
1598
1599function SizeControl({control, value, onChange}: ControlProps) {
1600 return (
1601 <Wrapper control={control} styles={style({gridColumnStart: 1, gridColumnEnd: -1})}>
1602 <div className={style({display: 'flex', gap: 4, width: controlWidth})}>
1603 <NumberField
1604 aria-label="Width"
1605 placeholder="–"
1606 value={value?.width}
1607 onChange={width => onChange(new Size(width, value?.height ?? 0))}
1608 styles={style({flexShrink: 1, flexGrow: 1})}
1609 hideStepper
1610 />
1611 <NumberField
1612 aria-label="Height"
1613 placeholder="–"
1614 value={value?.height}
1615 onChange={height => onChange(new Size(value?.width ?? 0, height))}
1616 styles={style({flexShrink: 1, flexGrow: 1})}
1617 hideStepper
1618 />
1619 </div>
1620 </Wrapper>
1621 );
1622}

Callers

nothing calls this directly

Calls 1

onChangeFunction · 0.70

Tested by

no test coverage detected