Principes Bases Accessibilité Système de design Guidelines Deutsch Français Italiano English Nos principes de design Centré sur l’utilisateur Reconnaissable Inclusif Minimaliste Holistique Auto-explicatif Axé sur les tâches Approprié Portail de la marque CFF Logo Horloge numérique Droits d’utilisation Couleurs de base Couleurs supplémentaires Couleurs off-brand Icônes Icônes de l’horaire Pictogrammes À propos de l’accessibilité À propos de ce guide Contact Informations complémentaires Product Owner User Research Interaction Design Visual Design Development Content Design Testing What is a design system? Conception Développer FAQ Aide Procès Contribution Contact Aperçu Base Composants Aperçu Releases Design Tokens Composants Aperçu Base Informations Aperçu Base Composants Aperçu Power-Apps Bandeaux publicitaires numériques SAP IA Design : Bases Icônes d’applications Cette page n'est pas disponible dans la langue souhaitée. Langues disponibles: Deutsch English Checkbox-Group Info

Was macht die Komponente?

Sie gewährleistet das Layout bei einer Gruppe von Checkboxen.

Wann soll die Komponente eingesetzt werden?

  • Nur in Kombination mit der Checkbox-Komponente.
Checkbox Checkbox-Panel
Anatomie

Anatomie der Komponente


Nummer Typ Beschreibung Optional Hinweis
1a Komponente sbb-checkbox Nein checked
1b Komponente sbb-checkbox Nein unchecked
2 Error sbb-form-error
Demo

Spielwiese

Label 1 Label 2 Label 3
Orientierung Vertikal Horizontal Grössen XS S M Icon Position Am Anfang Am Ende Mode (System-Einstellung) Light Dark Hintergrund White Midnight Milk Charcoal Cloud Iron Midnight White Charcoal Milk Iron Cloud
Horizontal
Vertical
Vertical To Horizontal
Horizontal Size M
Horizontal Size XS
Horizontal Disabled
Vertical Disabled
Horizontal Icon Start
Vertical Icon Start
Horizontal Icon End
Vertical Icon End
Vertical Icon End Long Label
Horizontal Witherror
Vertical Witherror
Indeterminate Group
Horizontal Panel
Vertical Panel
Vertical To Horizontal Panel
HTML in Zwischenablage kopiert.
Implementation

The sbb-checkbox-group component is used as a container for a collection of either
sbb-checkboxs, sbb-checkbox-panels,
or sbb-selection-expansion-panel.

<sbb-checkbox-group>
  <sbb-checkbox value="checkbox-1">Label 1</sbb-checkbox>
  <sbb-checkbox value="checkbox-2">Label 2</sbb-checkbox>
  <sbb-checkbox value="checkbox-3">Label 3</sbb-checkbox>
</sbb-checkbox-group>

<sbb-checkbox-group>
  <sbb-selection-expansion-panel>
    <sbb-checkbox-panel>
      Value
      <span slot="suffix">
        <sbb-icon></sbb-icon>
        <span class="sbb-text-xs sbb-text--bold">CHF</span>
        <span class="sbb-text-m sbb-text--bold">40.00</span>
      </span>
    </sbb-checkbox-panel>
  </sbb-selection-expansion-panel>
</sbb-checkbox-group>

Slots

The content is projected in an unnamed slot.

The component can display one or more sbb-error components
right below the sbb-checkbox-group using the error slot.

<sbb-checkbox-group>
  <sbb-checkbox value="checkbox-1">Label 1</sbb-checkbox>
  <sbb-checkbox value="checkbox-2">Label 2</sbb-checkbox>
  <sbb-checkbox value="checkbox-3">Label 3</sbb-checkbox>
  <sbb-error slot="error">You must accept all the terms and conditions.</sbb-error>
</sbb-checkbox-group>

States

It is possible to mark the entire group as disabled or required using the properties disabled and required.

<!-- All the child sbb-checkbox will be marked as required. -->
<sbb-checkbox-group required> ... </sbb-checkbox-group>

<!-- All the child sbb-checkbox will be marked as disabled. -->
<sbb-checkbox-group disabled> ... </sbb-checkbox-group>

Style

The orientation property is used to set item orientation.
Possible values are horizontal (default) and vertical.
The optional property horizontalFrom can be used in combination with orientation='vertical' to
indicate the minimum breakpoint from which the orientation changes to horizontal.

<sbb-checkbox-group orientation="vertical" horizontal-from="large"> ... </sbb-checkbox-group>

The component has a size property, which can be used to change the size
of all the inner sbb-checkbox or sbb-checkbox-panel elements. Available sizes are xs, s and m.

<sbb-checkbox-group size="s"> ... </sbb-checkbox-group>

Properties

Name Attribute Privacy Type Default Description
checkboxes - public (SbbCheckboxElement | SbbCheckboxPanelElement)[] List of contained checkbox elements.
disabled disabled public boolean false Whether the component is disabled.
horizontalFrom horizontal-from public SbbHorizontalFrom | null null Overrides the behaviour of orientation property.
orientation orientation public SbbOrientation 'horizontal' Indicates the orientation of the checkboxes inside the <sbb-checkbox-group>.
required required public boolean false Whether the checkbox group is required.
size size public SbbCheckboxSize 'm' / 'xs' (lean) Size variant, either xs, s or m.

Slots

Name Description
Use the unnamed slot to add sbb-checkbox elements to the sbb-checkbox-group.
error Slot used to render a sbb-error inside the sbb-checkbox-group.