Cette page n'est pas disponible dans la langue souhaitée. Langues disponibles: Deutsch English Selection-Action-Panel. Übersicht

Aperçu.

Halbtax Ein Jahr gültig

Was macht die Komponente?

Das Selection-Action-Panel verbindet ein Checkbox-Panel oder ein Radio-Button-Panel mit einer Aktion, z.B. einem Button. So können Nutzende eine Option auswählen und direkt eine zugehörige Aktion auslösen.

Wann soll die Komponente eingesetzt werden?

  • Wenn zu einer Option eine eigene Aktion gehört, z.B. Details anzeigen oder die Option bearbeiten.
  • Wenn Optionen und Aktionen in einer Liste zusammen dargestellt werden sollen.

Composant similaire.

Selection-Expansion-Panel
Anwendung

Regeln.

  • Selection-Action-Panels werden innerhalb einer Checkbox-Group oder Radio-Button-Group eingesetzt.
  • Pro Panel gibt es genau eine Aktion. Sie muss sich klar von der Auswahl der Option unterscheiden.
  • Die Aktion soll verständlich beschriftet sein. Bei einem Button nur mit Icon braucht es eine Beschriftung für Screenreader.
  • Sollen zusätzliche Inhalte aufklappen, wird das Selection-Action-Panel mit dem Selection-Expansion-Panel kombiniert.

Spécification.

Beispiele With Checkbox.
With Radio Button.
Size S.
Checked.
Disabled.
Milk.
Borderless.
With Expansion Panel.
With Checkbox Group.
With Radio Button Group.
HTML in Zwischenablage kopiert.
Implementation

Web Components.

Le web component se trouve dans le paquet @sbb-esta/lyne-elements.

Storybook avec exemples interactifs Code source sur GitHub

Documentation.

The <sbb-selection-action-panel> component wraps either a sbb-checkbox-panel
or a sbb-radio-button-panel and an action element (e.g. an <sbb-secondary-button> or a native button).

<sbb-selection-action-panel>
  <sbb-radio-button-panel>
    Value
    <span slot="subtext">Subtext</span>
  </sbb-radio-button-panel>

  <!-- action -->
  <sbb-secondary-button icon-name="arrow-right-small">...</sbb-secondary-button>
  <!-- or -->
  <button class="sbb-action">...</button>
</sbb-selection-action-panel>
With expansion panel.

It is possible to combine the usage of the <sbb-selection-action-panel> and the sbb-selection-expansion-panel.

<sbb-selection-expansion-panel>
  <sbb-selection-action-panel>
    <sbb-radio-button-panel color="milk" borderless>
      Value
      <span slot="subtext">Subtext</span>
    </sbb-radio-button-panel>

    <sbb-secondary-button icon-name="arrow-right-small">...</sbb-secondary-button>
  </sbb-selection-action-panel>

  <!-- inner content -->
  <div slot="content">Inner Content</div>
</sbb-selection-expansion-panel>
In a group.

The selection panel can also be used inside a sbb-radio-button-group
or a sbb-checkbox-group.

With <sbb-radio-button-group>:

<sbb-radio-button-group>
  <sbb-selection-action-panel>
    <sbb-radio-button-panel>
      Value
      <span slot="subtext">Subtext</span>
    </sbb-radio-button-panel>
    <sbb-secondary-button icon-name="arrow-right-small"></sbb-secondary-button>
    <sbb-card-badge>%</sbb-card-badge>
  </sbb-selection-action-panel>
  ...
</sbb-radio-button-group>

With <sbb-checkbox-group>:

<sbb-checkbox-group>
  <sbb-selection-action-panel>
    <sbb-checkbox-panel>
      Value
      <span slot="subtext">Subtext</span>
    </sbb-checkbox-panel>
    <sbb-secondary-button icon-name="arrow-right-small"></sbb-secondary-button>
    <sbb-card-badge>%</sbb-card-badge>
  </sbb-selection-action-panel>
  ...
</sbb-checkbox-group>
Style.

The component inherits its style from the slotted panel component (<sbb-checkbox-panel> or <sbb-radio-button-panel>).

Angular.

Ce composant est également disponible pour Angular dans le paquet @sbb-esta/lyne-angular.

Aperçu Angular API Angular Exemples Angular
API

class: SbbSelectionActionPanelElement, sbb-selection-action-panel.

Properties.

Name Attribute Privacy Type Default Description
group - public SbbRadioButtonGroupElement | SbbCheckboxGroupElement | null Group element if present
panel - public SbbCheckboxPanelElement | SbbRadioButtonPanelElement | null Input panel element

Slots.

Name Description
Use this slot to render a sbb-checkbox-panel or sbb-radio-button-panel element and the action element.
badge Use this slot to render a sbb-card-badge component.