A alternative to ion-checkbox which adds accessibility functionality. Use it instead of ion-checkbox.

For manipulation of ion-checkbox properties after initialisation use the ion-component directly.

Properties

announcementChecked: string = 'aktiviert'

Text which gets announced in a screen reader when the checkbox gets checked.

announcementSilent: boolean = false

Turns off the screen reader announcement.

announcementUnchecked: string = 'nicht aktiviert'

Text which gets announced in a screen reader when the checkbox gets unchecked.

announcementWithLabel: boolean = false

Announces the (un)checked status together with the label.

checkboxId: string

The id of the actual checkbox element.

checkboxLabel: string

The aria-label value given to the wrapped checkbox field.

checkboxLabelledby: string

The aria-labelledby value given to the wrapped checkbox field.

The component actually takes the textContent from the label component and creates an aria-label value out of it.

checkboxRole: "option" | "switch" | "checkbox" = 'checkbox'

The role of the checkbox.

A "switch" represents on/off values, as opposed to checked/unchecked values for a "checkbox". "option" is given automaticly when part of a hylo-checkbox-group.

checked: boolean = false

Same as ion-checkbox.

color: string

Same as ion-checkbox.

disabled: boolean = false

Same as ion-checkbox.

dontAriaHideIonLabel: boolean

An ion-label component which is bundled with this component under an ion-item is aria-hidden by default. This setting disables the default setting. You can still set the aria-hidden attribute manually.

errorMessageId: string

The id of an element which holds an error message for this component. The error message is only considered when the component is invalid.

indeterminate: boolean = false

Same as ion-checkbox.

invalid: boolean = null

If not set, the component determents its invalidation based on "required" and its value.

mode: "md" | "ios"

Same as ion-checkbox.

name: string

Same as ion-checkbox.

readonly: boolean = false

Sets the wrapped ion-checkbox to "disabled" but keeps the value to be sent.

required: boolean

Is the checkbox required to be checked.

value: string = 'on'

Same as ion-checkbox.

Methods

  • Returns whether the wrapped ion-checkbox component is checked.

    Returns Promise<boolean>

  • Returns the wrapped ion-checkbox component.

    Returns Promise<HTMLIonCheckboxElement>

  • Returns the value of the wrapped ion-checkbox component.

    Returns Promise<string>

  • Sets the aria position of the element in a group of elements.

    if "position" and "total" is set to 0, the attributes are removed.

    Parameters

    • position: number
    • total: number

    Returns Promise<void>

Events

hyloHasFocus: EventEmitter<boolean>

Fires when the component gains or looses focus through the "tab" key. The component also toggles the class "hylo-has-focus".

The emitted boolean value indicates whether the component gained or lost the focus.

Generated using TypeDoc