Switch
Immediate boolean settings
Five practical starting points. Explore a live example, then open its exact document in Studio.
Notifications
Notifications demonstrates immediate boolean settings. Edit content, composition and responsive styling in Studio.
Usage code · exact rendered document
'use client';
import type { CSSProperties } from "react";
import { SigmaUIProvider, Stack, Switch } from "sigmaui";
import type { TrustedBindings } from "sigmaui";
import "sigmaui/styles.css";
// Supply trusted action callbacks and pricing data from the host application.
// Images retain validated asset URLs. Importing handwritten JSX into Studio is unsupported.
export default function Page({ bindings = {} }: { bindings?: TrustedBindings }) {
return (
<SigmaUIProvider style={{ containerType: "inline-size" }} theme="minimal" mode="light">
<style>{".sigma-export-1wbdrof-gtvrgz-ex-d3faa0fe713b-el-178{width:100% !important;max-width:100% !important;position:relative !important;left:auto !important;top:auto !important}.sigma-export-1wbdrof-gtvrgz-ex-d3faa0fe713b-el-178 \u003e *{width:100% !important}\n.sigma-export-1wbdrof-gtvrgz-ex-d3faa0fe713b-el-179{width:100% !important;position:relative !important;left:auto !important;top:auto !important}.sigma-export-1wbdrof-gtvrgz-ex-d3faa0fe713b-el-179 \u003e *{width:100% !important}\n.sigma-export-1wbdrof-gtvrgz-ex-d3faa0fe713b-el-180{width:100% !important;position:relative !important;left:auto !important;top:auto !important}.sigma-export-1wbdrof-gtvrgz-ex-d3faa0fe713b-el-180 \u003e *{width:100% !important}"}</style>
<div className="sigma-stack">
<div className="sigma-node sigma-export-1wbdrof-gtvrgz-ex-d3faa0fe713b-el-178" data-node="ex-d3faa0fe713b-el-178" style={{"--node-gap":"16px","--node-mobile":1,"--node-tablet":2} as CSSProperties}>
<Stack>
<div className="sigma-node sigma-export-1wbdrof-gtvrgz-ex-d3faa0fe713b-el-179" data-node="ex-d3faa0fe713b-el-179" style={{"--node-mobile":1,"--node-tablet":2} as CSSProperties}>
<Switch label={"Email notifications"} defaultChecked={false} disabled={false} />
</div>
<div className="sigma-node sigma-export-1wbdrof-gtvrgz-ex-d3faa0fe713b-el-180" data-node="ex-d3faa0fe713b-el-180" style={{"--node-mobile":1,"--node-tablet":2} as CSSProperties}>
<Switch label={"Push notifications"} defaultChecked={false} disabled={false} />
</div>
</Stack>
</div>
</div>
</SigmaUIProvider>
);
}
Dark mode preference
Dark mode preference demonstrates immediate boolean settings. Edit content, composition and responsive styling in Studio.
Usage code · exact rendered document
'use client';
import type { CSSProperties } from "react";
import { SigmaUIProvider, Stack, Switch } from "sigmaui";
import type { TrustedBindings } from "sigmaui";
import "sigmaui/styles.css";
// Supply trusted action callbacks and pricing data from the host application.
// Images retain validated asset URLs. Importing handwritten JSX into Studio is unsupported.
export default function Page({ bindings = {} }: { bindings?: TrustedBindings }) {
return (
<SigmaUIProvider style={{ containerType: "inline-size" }} theme="minimal" mode="light">
<style>{".sigma-export-1dk8xj8-1ki5taa-ex-6989d7030f4a-el-185{width:100% !important;max-width:100% !important;position:relative !important;left:auto !important;top:auto !important}.sigma-export-1dk8xj8-1ki5taa-ex-6989d7030f4a-el-185 \u003e *{width:100% !important}\n.sigma-export-1dk8xj8-1ki5taa-ex-6989d7030f4a-el-186{width:100% !important;position:relative !important;left:auto !important;top:auto !important}.sigma-export-1dk8xj8-1ki5taa-ex-6989d7030f4a-el-186 \u003e *{width:100% !important}"}</style>
<div className="sigma-stack">
<div className="sigma-node sigma-export-1dk8xj8-1ki5taa-ex-6989d7030f4a-el-185" data-node="ex-6989d7030f4a-el-185" style={{"--node-gap":"16px","--node-mobile":1,"--node-tablet":2} as CSSProperties}>
<Stack>
<div className="sigma-node sigma-export-1dk8xj8-1ki5taa-ex-6989d7030f4a-el-186" data-node="ex-6989d7030f4a-el-186" style={{"--node-mobile":1,"--node-tablet":2} as CSSProperties}>
<Switch label={"Use dark appearance"} defaultChecked={false} disabled={false} />
</div>
</Stack>
</div>
</div>
</SigmaUIProvider>
);
}
Auto save preference
Auto save preference demonstrates immediate boolean settings. Edit content, composition and responsive styling in Studio.
Usage code · exact rendered document
'use client';
import type { CSSProperties } from "react";
import { SigmaUIProvider, Stack, Switch } from "sigmaui";
import type { TrustedBindings } from "sigmaui";
import "sigmaui/styles.css";
// Supply trusted action callbacks and pricing data from the host application.
// Images retain validated asset URLs. Importing handwritten JSX into Studio is unsupported.
export default function Page({ bindings = {} }: { bindings?: TrustedBindings }) {
return (
<SigmaUIProvider style={{ containerType: "inline-size" }} theme="minimal" mode="light">
<style>{".sigma-export-lvs2qg-5uwtky-ex-0b90b72e7d32-el-191{width:100% !important;max-width:100% !important;position:relative !important;left:auto !important;top:auto !important}.sigma-export-lvs2qg-5uwtky-ex-0b90b72e7d32-el-191 \u003e *{width:100% !important}\n.sigma-export-lvs2qg-5uwtky-ex-0b90b72e7d32-el-192{width:100% !important;position:relative !important;left:auto !important;top:auto !important}.sigma-export-lvs2qg-5uwtky-ex-0b90b72e7d32-el-192 \u003e *{width:100% !important}"}</style>
<div className="sigma-stack">
<div className="sigma-node sigma-export-lvs2qg-5uwtky-ex-0b90b72e7d32-el-191" data-node="ex-0b90b72e7d32-el-191" style={{"--node-gap":"16px","--node-mobile":1,"--node-tablet":2} as CSSProperties}>
<Stack>
<div className="sigma-node sigma-export-lvs2qg-5uwtky-ex-0b90b72e7d32-el-192" data-node="ex-0b90b72e7d32-el-192" style={{"--node-mobile":1,"--node-tablet":2} as CSSProperties}>
<Switch label={"Save local drafts automatically"} defaultChecked={true} disabled={false} />
</div>
</Stack>
</div>
</div>
</SigmaUIProvider>
);
}
Privacy preference
Privacy preference demonstrates immediate boolean settings. Edit content, composition and responsive styling in Studio.
Usage code · exact rendered document
'use client';
import type { CSSProperties } from "react";
import { SigmaUIProvider, Stack, Switch } from "sigmaui";
import type { TrustedBindings } from "sigmaui";
import "sigmaui/styles.css";
// Supply trusted action callbacks and pricing data from the host application.
// Images retain validated asset URLs. Importing handwritten JSX into Studio is unsupported.
export default function Page({ bindings = {} }: { bindings?: TrustedBindings }) {
return (
<SigmaUIProvider style={{ containerType: "inline-size" }} theme="minimal" mode="light">
<style>{".sigma-export-1t7ffbh-gu4hgz-ex-5fc5786a2cf6-el-197{width:100% !important;max-width:100% !important;position:relative !important;left:auto !important;top:auto !important}.sigma-export-1t7ffbh-gu4hgz-ex-5fc5786a2cf6-el-197 \u003e *{width:100% !important}\n.sigma-export-1t7ffbh-gu4hgz-ex-5fc5786a2cf6-el-198{width:100% !important;position:relative !important;left:auto !important;top:auto !important}.sigma-export-1t7ffbh-gu4hgz-ex-5fc5786a2cf6-el-198 \u003e *{width:100% !important}\n.sigma-export-1t7ffbh-gu4hgz-ex-5fc5786a2cf6-el-199{width:100% !important;position:relative !important;left:auto !important;top:auto !important}.sigma-export-1t7ffbh-gu4hgz-ex-5fc5786a2cf6-el-199 \u003e *{width:100% !important}"}</style>
<div className="sigma-stack">
<div className="sigma-node sigma-export-1t7ffbh-gu4hgz-ex-5fc5786a2cf6-el-197" data-node="ex-5fc5786a2cf6-el-197" style={{"--node-gap":"16px","--node-mobile":1,"--node-tablet":2} as CSSProperties}>
<Stack>
<div className="sigma-node sigma-export-1t7ffbh-gu4hgz-ex-5fc5786a2cf6-el-198" data-node="ex-5fc5786a2cf6-el-198" style={{"--node-mobile":1,"--node-tablet":2} as CSSProperties}>
<Switch label={"Hide activity status"} defaultChecked={false} disabled={false} />
</div>
<div className="sigma-node sigma-export-1t7ffbh-gu4hgz-ex-5fc5786a2cf6-el-199" data-node="ex-5fc5786a2cf6-el-199" style={{"--node-mobile":1,"--node-tablet":2} as CSSProperties}>
<Switch label={"Limit profile visibility"} defaultChecked={false} disabled={false} />
</div>
</Stack>
</div>
</div>
</SigmaUIProvider>
);
}
Compact setting
Compact setting demonstrates immediate boolean settings. Edit content, composition and responsive styling in Studio.
Usage code · exact rendered document
'use client';
import type { CSSProperties } from "react";
import { ExtendedElement, SigmaUIProvider, Stack, Switch } from "sigmaui";
import type { TrustedBindings } from "sigmaui";
import "sigmaui/styles.css";
// Supply trusted action callbacks and pricing data from the host application.
// Images retain validated asset URLs. Importing handwritten JSX into Studio is unsupported.
export default function Page({ bindings = {} }: { bindings?: TrustedBindings }) {
return (
<SigmaUIProvider style={{ containerType: "inline-size" }} theme="minimal" mode="light">
<style>{".sigma-export-1vl6s3x-1yfcjhv-ex-e94d5d1aa56a-el-203{width:100% !important;max-width:100% !important;position:relative !important;left:auto !important;top:auto !important}.sigma-export-1vl6s3x-1yfcjhv-ex-e94d5d1aa56a-el-203 \u003e *{width:100% !important}\n.sigma-export-1vl6s3x-1yfcjhv-ex-e94d5d1aa56a-el-205{width:100% !important;position:relative !important;left:auto !important;top:auto !important}.sigma-export-1vl6s3x-1yfcjhv-ex-e94d5d1aa56a-el-205 \u003e *{width:100% !important}\n.sigma-export-1vl6s3x-1yfcjhv-ex-e94d5d1aa56a-el-204{width:100% !important;position:relative !important;left:auto !important;top:auto !important}.sigma-export-1vl6s3x-1yfcjhv-ex-e94d5d1aa56a-el-204 \u003e *{width:100% !important}"}</style>
<div className="sigma-stack">
<div className="sigma-node sigma-export-1vl6s3x-1yfcjhv-ex-e94d5d1aa56a-el-203" data-node="ex-e94d5d1aa56a-el-203" style={{"--node-gap":"16px","--node-mobile":1,"--node-tablet":2} as CSSProperties}>
<Stack>
<div className="sigma-node sigma-export-1vl6s3x-1yfcjhv-ex-e94d5d1aa56a-el-205" data-node="ex-e94d5d1aa56a-el-205" style={{"--node-mobile":1,"--node-tablet":2} as CSSProperties}>
<ExtendedElement kind={"Text"} props={{"text":"Applies immediately in this local demonstration."}} />
</div>
<div className="sigma-node sigma-export-1vl6s3x-1yfcjhv-ex-e94d5d1aa56a-el-204" data-node="ex-e94d5d1aa56a-el-204" style={{"--node-mobile":1,"--node-tablet":2} as CSSProperties}>
<Switch label={"Enable compact interface"} defaultChecked={false} disabled={false} />
</div>
</Stack>
</div>
</div>
</SigmaUIProvider>
);
}
Protected properties
binding, id, type, version, role, intent. Trusted host bindings remain protected.
Composition & accessibility
Uses the shared primitive contract. Use meaningful labels and a logical heading hierarchy. Interactive submissions are simulated locally.