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

Function BooleanControl

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

Source from the content-addressed store, hash-verified

773}
774
775function BooleanControl({control, value, onChange}: ControlProps) {
776 return (
777 <Wrapper control={control}>
778 <div
779 className={style({
780 display: {default: 'flex', lg: 'contents'},
781 minHeight: 32,
782 alignItems: 'center'
783 })}>
784 <Switch isSelected={value || false} onChange={onChange} aria-label={control.name} />
785 </div>
786 </Wrapper>
787 );
788}
789
790const controlWidth = {default: 'full', sm: 130} as const;
791

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected