Skip to content

utils/actionVariant

Overview

Resolves a model action's Button (tone, emphasis) from two layers. Layer 1 is the action's intrinsic, placement-independent tone (the color axis): a delete/destroy action is destructive, everything else neutral. Layer 2 is contextual (the structure axis): the view's hero action is promoted to a filled CTA, and every other action uses the placement emphasis chosen by where it is rendered (outline in a page-title or action bar, ghost in a dense bulk strip). Shared by LinkModelView, the single chokepoint every action button renders through, so the two layers resolve in exactly one place.

Methods

  • actionTone - The intrinsic, placement-independent tone for an action.
  • resolveActionVariant - Folds the two layers into a { tone, emphasis } pair for Button.

Types

ActionVariantInput

Source

client/lib/utils/actionVariant.js:1

Documents matching: server v3.0.0a1.post1client v3.0.0-alpha.2