Skip to content

Switch

Show design guidelines

HTML React Angular
Label Help or instructional text goes here
<certara-switch name="example-1">
Label
<span slot="help">Help or instructional text goes here</span>
</certara-switch>
import { CertaraSwitch } from '@certara/certara-ui-react';
<CertaraSwitch name="example-1">
Label
<span slot="help">Help or instructional text goes here</span>
</CertaraSwitch>
// In your module (e.g., app.module.ts)
import { CertaraUiAngularModule } from '@certara/certara-ui-angular';
@NgModule({
imports: [CertaraUiAngularModule]
})
// In your template:
<certara-switch name="example-1">
Label
<span slot="help">Help or instructional text goes here</span>
</certara-switch>

A toggle switch component for binary on/off states.

alignment

Attributealignment
Type"left" | "right"
Defaultundefined
Requiredfalse
DescriptionControls the horizontal alignment of the switch relative to its label.

checked

Attributechecked
Typeboolean
Defaultfalse
Requiredfalse
DescriptionWhether the switch is in the “on” state.

disabled

Attributedisabled
Typeboolean
Defaultfalse
Requiredfalse
DescriptionWhether the switch is disabled and non-interactive.

hideLabel

Attributehide-label
Typeboolean
Defaultfalse
Requiredfalse
DescriptionVisually hides the label while keeping it accessible to screen readers.

name

Attributename
Typestring
Defaultthis.inputId
Requiredfalse
DescriptionThe name attribute for the underlying input element. Defaults to a unique auto-generated ID.

size

Attributesize
Type"default" | "sm"
Default'default'
Requiredfalse
DescriptionThe size variant of the switch.

value

Attributevalue
Typeany
Default'on'
Requiredfalse
DescriptionThe value submitted with form data when checked.
NameDescriptionBubbles
certaraBlurEmitted when the switch loses focus.true
certaraChangeEmitted when the switch state changes. Event detail contains checked (boolean) and value properties.true
certaraFocusEmitted when the switch receives focus.true

There are no public methods available for this component

NameDescription
Default slot for the label text
helpOptional help text displayed below the label. Supports interactive elements like links.