button
Buttons come in four variations: primary
, secondary
, tertiary
and close
.
The first three variations allow for an icon and a label, with either optional. To ensure correct display, use the -without-label
and -without-icon
classes when omitting the label or icon, respectively.
A helper class -fixed
helps with buttons that have a fixed width.
Buttons do not bring any margins, but should have a spacing of 16px
between them. For an example, see Dialog.
You can consider using the data-frok-action
attribute to convey the semantic meaning of the button. See the Dialog component for an example.
For accessibility reasons, do not use
a
tags for buttons!
table of content
- description
- component variations
- primary label
- primary label icon
- primary icon
- primary label fixed
- primary icon fixed
- primary label icon fixed
- primary label disabled
- primary icon disabled
- primary label icon disabled
- secondary label
- secondary icon
- secondary label icon
- secondary label fixed
- secondary icon fixed
- secondary label icon fixed
- secondary label disabled
- secondary icon disabled
- secondary label icon disabled
- tertiary label
- tertiary icon
- tertiary label icon
- tertiary label fixed
- tertiary icon fixed
- tertiary label icon fixed
- tertiary label disabled
- tertiary icon disabled
- tertiary label icon disabled
- integrated label
- integrated icon
- integrated label icon
- integrated label fixed
- integrated icon fixed
- integrated label icon fixed
- integrated label disabled
- integrated icon disabled
- integrated label icon disabled
- close
- close disabled
- style scss
component variations
primary label
<button type="button" class="a-button a-button--primary -without-icon">
<span class="a-button__label">Button label</span>
</button>
primary label icon
<button type="button" class="a-button a-button--primary">
<i class="a-icon a-button__icon boschicon-bosch-ic-emoji-happy"></i>
<span class="a-button__label">Button label</span>
</button>
primary icon
<button
type="button"
class="a-button a-button--primary -without-label"
aria-label="accessibility label"
>
<i class="a-icon a-button__icon boschicon-bosch-ic-emoji-happy"></i>
</button>
primary label fixed
<button type="button" class="a-button a-button--primary -fixed -without-icon">
<span class="a-button__label">Button label</span>
</button>
primary icon fixed
<button
type="button"
class="a-button a-button--primary -fixed -without-label"
aria-label="accessibility label"
>
<i class="a-icon a-button__icon boschicon-bosch-ic-emoji-happy"></i>
</button>
primary label icon fixed
<button type="button" class="a-button a-button--primary -fixed">
<i class="a-icon a-button__icon boschicon-bosch-ic-emoji-happy"></i>
<span class="a-button__label">Button label</span>
</button>
primary label disabled
<button
type="button"
class="a-button a-button--primary -without-icon"
disabled=""
>
<span class="a-button__label">Button label</span>
</button>
primary icon disabled
<button
type="button"
class="a-button a-button--primary -without-label"
disabled=""
aria-label="accessibility label"
>
<i class="a-icon a-button__icon boschicon-bosch-ic-emoji-happy"></i>
</button>
primary label icon disabled
<button type="button" class="a-button a-button--primary" disabled="">
<i class="a-icon a-button__icon boschicon-bosch-ic-emoji-happy"></i>
<span class="a-button__label">Button label</span>
</button>
secondary label
<button type="button" class="a-button a-button--secondary -without-icon">
<span class="a-button__label">Button label</span>
</button>
secondary icon
<button
type="button"
class="a-button a-button--secondary -without-label"
aria-label="accessibility label"
>
<i class="a-icon a-button__icon boschicon-bosch-ic-emoji-happy"></i>
</button>
secondary label icon
<button type="button" class="a-button a-button--secondary">
<i class="a-icon a-button__icon boschicon-bosch-ic-emoji-happy"></i>
<span class="a-button__label">Button label</span>
</button>
secondary label fixed
<button type="button" class="a-button a-button--secondary -fixed -without-icon">
<span class="a-button__label">Button label</span>
</button>
secondary icon fixed
<button
type="button"
class="a-button a-button--secondary -fixed -without-label"
aria-label="accessibility label"
>
<i class="a-icon a-button__icon boschicon-bosch-ic-emoji-happy"></i>
</button>
secondary label icon fixed
<button type="button" class="a-button a-button--secondary -fixed">
<i class="a-icon a-button__icon boschicon-bosch-ic-emoji-happy"></i>
<span class="a-button__label">Button label</span>
</button>
secondary label disabled
<button
type="button"
class="a-button a-button--secondary -without-icon"
disabled=""
>
<span class="a-button__label">Button label</span>
</button>
secondary icon disabled
<button
type="button"
class="a-button a-button--secondary -without-label"
disabled=""
aria-label="accessibility label"
>
<i class="a-icon a-button__icon boschicon-bosch-ic-emoji-happy"></i>
</button>
secondary label icon disabled
<button type="button" class="a-button a-button--secondary" disabled="">
<i class="a-icon a-button__icon boschicon-bosch-ic-emoji-happy"></i>
<span class="a-button__label">Button label</span>
</button>
tertiary label
<button type="button" class="a-button a-button--tertiary -without-icon">
<span class="a-button__label">Button label</span>
</button>
tertiary icon
<button
type="button"
class="a-button a-button--tertiary -without-label"
aria-label="accessibility label"
>
<i class="a-icon a-button__icon boschicon-bosch-ic-emoji-happy"></i>
</button>
tertiary label icon
<button type="button" class="a-button a-button--tertiary">
<i class="a-icon a-button__icon boschicon-bosch-ic-emoji-happy"></i>
<span class="a-button__label">Button label</span>
</button>
tertiary label fixed
<button type="button" class="a-button a-button--tertiary -fixed -without-icon">
<span class="a-button__label">Button label</span>
</button>
tertiary icon fixed
<button
type="button"
class="a-button a-button--tertiary -fixed -without-label"
aria-label="accessibility label"
>
<i class="a-icon a-button__icon boschicon-bosch-ic-emoji-happy"></i>
</button>
tertiary label icon fixed
<button type="button" class="a-button a-button--tertiary -fixed">
<i class="a-icon a-button__icon boschicon-bosch-ic-emoji-happy"></i>
<span class="a-button__label">Button label</span>
</button>
tertiary label disabled
<button
type="button"
class="a-button a-button--tertiary -without-icon"
disabled=""
>
<span class="a-button__label">Button label</span>
</button>
tertiary icon disabled
<button
type="button"
class="a-button a-button--tertiary -without-label"
disabled=""
aria-label="accessibility label"
>
<i class="a-icon a-button__icon boschicon-bosch-ic-emoji-happy"></i>
</button>
tertiary label icon disabled
<button type="button" class="a-button a-button--tertiary" disabled="">
<i class="a-icon a-button__icon boschicon-bosch-ic-emoji-happy"></i>
<span class="a-button__label">Button label</span>
</button>
integrated label
<button type="button" class="a-button a-button--integrated -without-icon">
<span class="a-button__label">Button label</span>
</button>
integrated icon
<button
type="button"
class="a-button a-button--integrated -without-label"
aria-label="accessibility label"
>
<i class="a-icon a-button__icon boschicon-bosch-ic-emoji-happy"></i>
</button>
integrated label icon
<button type="button" class="a-button a-button--integrated">
<i class="a-icon a-button__icon boschicon-bosch-ic-emoji-happy"></i>
<span class="a-button__label">Button label</span>
</button>
integrated label fixed
<button
type="button"
class="a-button a-button--integrated -fixed -without-icon"
>
<span class="a-button__label">Button label</span>
</button>
integrated icon fixed
<button
type="button"
class="a-button a-button--integrated -fixed -without-label"
aria-label="accessibility label"
>
<i class="a-icon a-button__icon boschicon-bosch-ic-emoji-happy"></i>
</button>
integrated label icon fixed
<button type="button" class="a-button a-button--integrated -fixed">
<i class="a-icon a-button__icon boschicon-bosch-ic-emoji-happy"></i>
<span class="a-button__label">Button label</span>
</button>
integrated label disabled
<button
type="button"
class="a-button a-button--integrated -without-icon"
disabled=""
>
<span class="a-button__label">Button label</span>
</button>
integrated icon disabled
<button
type="button"
class="a-button a-button--integrated -without-label"
disabled=""
aria-label="accessibility label"
>
<i class="a-icon a-button__icon boschicon-bosch-ic-emoji-happy"></i>
</button>
integrated label icon disabled
<button type="button" class="a-button a-button--integrated" disabled="">
<i class="a-icon a-button__icon boschicon-bosch-ic-emoji-happy"></i>
<span class="a-button__label">Button label</span>
</button>
close
<button
type="button"
class="a-button a-button--integrated -without-label"
aria-label="close"
>
<i class="a-icon a-button__icon ui-ic-close"></i>
</button>
close disabled
<button
type="button"
class="a-button a-button--integrated -without-label"
disabled=""
aria-label="close"
>
<i class="a-icon a-button__icon ui-ic-close"></i>
</button>
additional content
styles SCSS
button {
background-color: var(--major-accent__enabled__fill__default);
border: 0;
color: var(--major-accent__enabled__front__default);
cursor: pointer;
display: inline-flex;
letter-spacing: 0;
padding: 0.75rem 1rem;
&:disabled {
cursor: default;
}
span {
padding: 0;
}
}
.a-button {
padding: 0;
&__label {
padding: 0.75rem 1rem 0.75rem 0;
.a-button--secondary & {
padding-top: 0.6875rem;
padding-right: 0.9375rem;
padding-bottom: 0.6875rem;
}
}
&__icon + &__label {
text-align: left;
}
&__icon {
font-size: 1.5rem;
padding: 0.75rem 0.5rem 0.75rem 0.75rem;
.a-button--secondary & {
padding-top: 0.6875rem;
padding-bottom: 0.6875rem;
padding-right: 0.8125rem;
}
}
&.-fixed {
justify-content: center;
width: 8rem;
}
&.-fixed &__label {
display: block;
text-overflow: ellipsis;
white-space: nowrap;
overflow: hidden;
}
&.-without-label &__icon {
margin: auto;
padding: 0.75rem;
}
&--secondary.-without-label &__icon {
margin: auto;
padding: 0.6875rem;
}
&.-without-icon &__label {
margin: auto;
padding: 0.75rem 1rem;
}
&--secondary.-without-icon &__label {
margin: auto;
padding: 0.6875rem 0.9375rem;
}
&:focus-visible {
@include focus-outside;
}
&--primary {
&:hover {
background-color: var(--major-accent__enabled__fill__hovered);
}
&:active {
background-color: var(--major-accent__enabled__fill__pressed);
}
&:disabled {
background-color: var(--major-accent__disabled__fill__default);
color: var(--major-accent__disabled__front__default);
}
}
&--secondary {
&:focus-visible {
--focus-offset-inner: 1px;
}
background-color: var(--minor-accent__enabled__fill__default);
color: var(--minor-accent__enabled__front__default);
border: 1px solid var(--minor-accent__enabled__front__default);
&:hover {
background-color: var(--minor-accent__enabled__fill__hovered);
color: var(--minor-accent__enabled__front__hovered);
border-color: var(--minor-accent__enabled__front__hovered);
}
&:active {
background-color: var(--minor-accent__enabled__fill__pressed);
color: var(--minor-accent__enabled__front__pressed);
border-color: var(--minor-accent__enabled__front__pressed);
}
&:disabled {
background-color: var(--minor-accent__disabled__fill__default);
color: var(--minor-accent__disabled__front__default);
border-color: var(--minor-accent__disabled__front__default);
}
}
&--tertiary {
background-color: var(--minor-accent__enabled__fill__default);
color: var(--minor-accent__enabled__front__default);
&:hover {
background-color: var(--minor-accent__enabled__fill__hovered);
color: var(--minor-accent__enabled__front__hovered);
}
&:active {
background-color: var(--minor-accent__enabled__fill__pressed);
color: var(--minor-accent__enabled__front__pressed);
}
&:disabled {
background-color: var(--minor-accent__disabled__fill__default);
color: var(--minor-accent__disabled__front__default);
}
}
&--integrated {
&:focus-visible {
@include focus-inside;
}
color: var(--integrated__enabled__front__default);
background-color: var(--integrated__enabled__fill__default);
&:hover {
color: var(--integrated__enabled__front__hovered);
background-color: var(--integrated__enabled__fill__hovered);
}
&:active {
color: var(--integrated__enabled__front__pressed);
background-color: var(--integrated__enabled__fill__pressed);
}
&:disabled {
color: var(--integrated__disabled__front__default);
background-color: var(--integrated__disabled__fill__default);
}
}
}