Skip to content
W WRNexusJS
forms component

PricingToggle

Reusable pricing toggle component.

@wrnexus/ui 0.2.6711 props1 slots0 events

Usage

Components are auto-discovered. Use the component directly in any .wrn view:

<PricingToggle
  label="Pricing"
  name="name"
  value="value"
  placeholder="placeholder"
  type="text"
/>

Legacy mount name: data-component="PricingToggle".

Props and attributes

PropTypeRequirementDefault
labelstringOptional"Pricing"
namestringOptional""
valuestringOptional""
placeholderstringOptional""
typestringOptional"text"
requiredbooleanOptionalfalse
disabledbooleanOptionalfalse
readonlybooleanOptionalfalse
helpstringOptional""
errorstringOptional""
classstringOptional""

Slots

  • default

Events

This component does not declare a custom event.

Source contract

Installed source: components/PricingToggle.wrn

component PricingToggle {
  props {
    label = "Pricing" 
    name = ""
    value = ""
    placeholder = ""
    type = "text"
    required = false
    disabled = false
    readonly = false
    help = ""
    error = ""
    class = ""
  }
  view {
        <label class="wire-field wire-catalog-field {class}">
        <span class="wire-label">{label}<span data-show="required" class="wire-required"> *</span>
        </span>
        <input name="{name}" value="{value}" placeholder="{placeholder}" type="{type}" required="{required}" disabled="{disabled}" readonly="{readonly}" aria-invalid="{error ? 'true' : 'false'}" class="wire-input" />
        <span data-show="help && !error" class="wire-field-message wire-field-message--help">{help}</span>
        <span data-show="error" role="alert" class="wire-field-message wire-field-message--error">{error}</span>
        <slot />
        </label>
    }
}