All
<span slot="amount">123</span>
</sbb-tag> Accessibility
The component imitates an <button>
element to provide an accessible experience.
The state is reflected via aria-pressed
attribute.
Properties
Property | Attribute | Description | Type | Default |
amount | amount | Amount displayed inside the tag. | string | undefined |
checked | checked | Whether the toggle is checked. | boolean | false |
disabled | disabled | Whether the tag is disabled. | boolean | false |
form | form | The | string | undefined |
iconName | icon-name | The icon name we want to use, choose from the small icon variants from the ui-icons category from https://icons.app.sbb.ch (optional). | string | undefined |
name | name | The name attribute to use for the button. | string | undefined |
value | value | Value of the tag. | string | undefined |
Events
Event | Description | Type |
change | Change event emitter | CustomEvent<any> |
didChange | [DEPRECATED] only used for React. Will probably be removed once React 19 is available.
| CustomEvent<any> |
input | Input event emitter | CustomEvent<any> |
state-change | Internal event that emits whenever the state of the tag in relation to the parent toggle changes. | CustomEvent<TagStateChangeChecked | TagStateChangeValue> |
Slots
Slot | Description |
"amount" | Provide an amount to show it at the component end. |
"icon" | Use this slot to display an icon at the component start, by providing a sbb-icon component. |
"unnamed" | This slot will show the provided tag label. |
Dependencies
Depends on
Graph
graph TD;
sbb-tag --> sbb-icon
style sbb-tag fill:#f9f,stroke:#333,stroke-width:4px
Demo label999
Nein Ja
Nein Ja
White Milk Iron Charcoal Black
Mehr Beispiele auf Storybook Impressum Contact Paramètres des cookies