Zur Navigation Zum Inhalt Kontakt Menu Find component Overview Lyne Principles Foundation Accessibility Design System Guidelines Deutsch Français Italiano English Our design principles User-centred Recognisable Inclusive Reduced Holistic Self-explanatory Task-oriented Appropriate SBB Brand portal Logo Digital clock Rights of use Base colors Functional colors Off brand colors Icons Timetable icons Pictograms About accessibility Über diesen Guide Contact Further information Product Owner User Research Interaction Design Visual Design Development Content Design Testing What is a design system? Designing Coding FAQ Help Process Contribution Contact Overview Base Components Overview Base Components Overview Base Components Overview Design Tokens Components Overview Base Informationen Sense & Purpose Community Assets Instructions Power-Apps Digital banner ads SAP Design Guidelines App Icons
Find component

Lyne

Basics Animation

Animation

Border

Border

Grid

Grid

Spacings

Spacings

Typography

Typography

Components Action-Group

Action-Group

Alert

Alert

Alert-Group

Alert-Group

Autocomplete

Autocomplete

Button

Button

Calendar

Calendar

Card

Card

Card-Badge

Card-Badge

Checkbox

Checkbox

Checkbox-Group

Checkbox-Group

Chip

Chip

Clock

Clock

Datepicker

Datepicker

Dialog

Dialog

Divider

Divider

Footer

Footer

Form-Error

Form-Error

Form-Field

Form-Field

Header

Header

Header-Action

Header-Action

Icon

Icon

Image

Image

Journey-Header

Journey-Header

Link

Link

Link-List

Link-List

Logo

Logo

Menu

Menu

Menu-Action

Menu-Action

Radio-Button

Radio-Button

Radio-Button-Group

Radio-Button-Group

Selection-Panel

Selection-Panel

Signet

Signet

Slider

Slider

Tab-Group

Tab-Group

Tab Title

Tab Title

Tag

Tag

Tag-Group

Tag-Group

Teaser

Teaser

Teaser-Hero

Teaser-Hero

Time-Input

Time-Input

Title

Title

Toggle

Toggle

Toggle-Check

Toggle-Check

Tooltip

Tooltip

Tooltip-Trigger

Tooltip-Trigger

Checkbox-Group Implementation

The <sbb-checkbox-group> component is used as a container for one or multiple <sbb-checkbox> components,
which are projected inside an unnamed slot.

The orientation property is used to set items 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.

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

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

Usage

Basic usage:

<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>

Required sbb-checkbox-group with error message:

<!-- All the child checkboxes will be marked as required-->
<sbb-checkbox-group required>
<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-form-error slot="error">You must accept all the terms and conditions.</sbb-form-error>
</sbb-checkbox-group>

Disabled sbb-checkbox-group with vertical orientation below large breakpoint and horizontal above:

<!-- All the child checkboxes will be disabled-->
<sbb-checkbox-group disabled orientation="vertical" horizontal-from="large">
<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>

Properties

Property Attribute Description Type Default
disabled disabled Whether the checkbox group is disabled. boolean false
horizontalFrom horizontal-from Overrides the behaviour of orientation property. "large" | "medium" | "micro" | "small" | "ultra" | "wide" | "zero" undefined
orientation orientation Indicates the orientation of the checkboxes inside the <sbb-checkbox-group>. "horizontal" | "vertical" 'horizontal'
required required Whether the checkbox group is required. boolean false
size size Size variant, either m or s. "m" | "s" 'm'

Slots

Slot Description
"error" Slot used to render the inside the .
"unnamed" Slot used to render the inside the .

Demo
Label 1Label 2Label 3
Vertical Horizontal
S M
At the beginning At end
White Milk Iron Charcoal Black
More examples on Storybook
Imprint Contact Cookie settings