Switches
Similar to Checkboxes, you can use Switches to indicate or control boolean values. They are usually used to turn a specific setting on or off.
certara-switch
Properties
| Property | Attribute | Description | Type | Default |
|---|---|---|---|---|
checked | checked | boolean | false | |
disabled | disabled | boolean | false | |
hideLabel | hide-label | boolean | false | |
name | name | string | this.inputId | |
size | size | "default" | "sm" | 'default' | |
value | value | any | 'on' |
Events
| Event | Description | Type |
|---|---|---|
certaraBlur | CustomEvent<void> | |
certaraChange | CustomEvent<CheckboxChangeEventDetail<any>> | |
certaraFocus | CustomEvent<void> |
Dependencies
Depends on
Graph
graph TD; certara-switch --> certara-help-block style certara-switch fill:#f9f,stroke:#333,stroke-width:4pxSymbols prefixed by underscore ("_")
When referencing/naming Symbol with a form input, any argument/option/variable that are endemic to the input itself (i.e. "id", "placeholder", "required") are **not** preceded by an _underscore. In other cases, an _underscore precedes to denote it affects the output of a container/parent element, or a sibling.
@switchInput(myForm(""), Symbol("_label") -> "", Symbol("id") -> "", Symbol("_inline") -> false, Symbol("_help") -> "", Symbol("_helpLink") -> Symbol("disabled") -> false, Symbol("checked") -> false, Symbol("class") -> "", Symbol("_class") -> "",)NameTypeDescriptionDefault valueCopy
- _labelstringText that describes the control. Will be both visible and clickable.blank
- idstring (required)adds an id to the
inputand a for attribute to the associated labellabelblank - _inlineboolean
trueinvokes the inline visual permutationfalse - disabledbooleanSets the field as to appear disabled, users will not be able to interact with the text field.false
- checkedbooleanspecifies that the
inputelement should be pre-selected (checked) when the page loads.false - classstringadds
class=""to the inputblank - _classstringadds
class=""to the container div (.form-check)blank - _helpstringoutputs additional help or instructional textblank
- _helpLinkhtml block (no quotes)appends a link to help or instructional textblank