Bbackstage

backstage/migrate-mui-typography-to-text

MUI 4 to BUI: Replace Typography with Text. Package name omits -bui- because Text is the BUI export name.

backstagemigrationmuibuitypographytext
Public
0 executions

Run locally

npx codemod @backstage/migrate-mui-typography-to-text

@backstage/migrate-mui-typography-to-text

Migrates MUI Typography to Backstage UI Text (valid TextVariants only).

Covers

  • Body / heading variants mapped to BUI Text variants
  • Emits as from the MUI variant default element when component is omitted (h5as="h5", body1as="p", …)
  • Named barrel imports; merge into existing @backstage/ui
  • Drops gutterBottom where unsupported

Variant map

MUIBUI TextDefault as
h1title-largeh1
h2title-mediumh2
h3title-smallh3
h4title-x-smallh4
h5title-x-smallh5
h6title-smallh6
subtitle1title-x-smallh6
subtitle2body-mediumh6
body1body-mediump
body2body-smallp
captionbody-x-smallspan

Explicit component still wins and becomes as.

TODOs / won't-do

  • Unmapped variants (unmapped-variant-todo)
  • Theme typography overrides / custom variant maps

Test

bash

Ready to contribute?

Build your own codemod and share it with the community.