11
Reference

Component Examples

Concrete examples for Button, Toggle, Checkbox, and Tab — showing which token roles each type uses and how to implement them in SCSS.

11.1 Button

Button has 4 types. Each uses a different subset of the 6 color roles from the Color / Active collection.

Typecoloron-colorcontaineron-containeroutlinefocus
primary✓ bg✓ text✓ focus
outline✓ text✓ border✓ focus
light✓ bg✓ text✓ focus
basic✓ text✓ focus

Size Tokens

Tokensmmdlg
button-height32px40px48px
button-padding-x8px16px16px
button-font-size14px14px16px
button-icon-size16px20px20px
button-gap4px8px8px

SCSS Implementation Sketch

SCSS — Button component
// Color classes (one per family)
.cck-button__color--brand    { --cck-color: var(--brand-color); /* ...all 6 */ }
.cck-button__color--danger   { --cck-color: var(--danger-color); /* ...all 6 */ }

// Type classes (one per type — reads color class vars)
.cck-button__type--primary:not(:disabled) {
  background-color: var(--cck-color);
  color:            var(--cck-on-color);
  height:           var(--button-height);
  padding:          0 var(--button-padding-x);
  font-size:        var(--button-font-size);
  border-radius:    var(--button-radius);
  &:focus-visible   { box-shadow: 0 0 0 3px var(--cck-focus); }
}

.cck-button__type--outline:not(:disabled) {
  background-color: transparent;
  color:            var(--cck-on-container);
  border:           1px solid var(--cck-outline);
  &:focus-visible   { box-shadow: 0 0 0 3px var(--cck-focus); }
}

// Disabled (structural — same for all types)
.cck-button:disabled {
  background-color: var(--button-disabled-bg);
  color:            var(--button-disabled-text);
  border-color:     var(--button-disabled-border);
  cursor:           not-allowed;
}

11.2 Toggle

Toggle uses only color (and optionally focus) from the shared collection. All other colors are structural.

StateTrack colorThumb colorSource
Unchecked--toggle-track-off (gray)--toggle-thumb (white)Structure collection
Checkedvar(--cck-color) (brand/danger/…)--toggle-thumb (white)Color/Active + Structure
Disabled (any)--toggle-track-disabled--toggle-thumb-disabledStructure collection

11.3 Checkbox

Checkbox uses color and focus from Color/Active. All other colors (border when unchecked, checkmark itself) are structural.

ElementStateColor Source
Box borderunchecked--checkbox-border-off{border-default} (Structural)
Box backgroundunchecked--checkbox-bg-off → transparent (Structural)
Box border + bgcheckedvar(--cck-color) (Color/Active)
Checkmark iconchecked--checkbox-checkmark → white (Structural)
Focus ringfocusedvar(--cck-focus) (Color/Active)

11.4 Tab

Tab has 4 types: fill, border, basic, and line. Each uses different roles:

TypeActive bgActive textIndicatorFocus
fillcoloron-colorfocus
bordercontaineron-containeroutlinefocus
basictransparenton-containerfocus
linetransparenton-containeroutline (underline)focus
💡
The Pattern is Consistent Every component follows the same two-class approach. Add the color class, add the type class. That's it. The same SCSS pattern works for Button, Toggle, Checkbox, Tab, Badge, Icon — every component.