Power Apps YAML: copy, paste, done

Power Apps Studio turns YAML into real controls when you paste it. This page shows what the code looks like, how to paste it, why a paste can fail, and where to get 185 ready-made YAML components.

What is Power Apps YAML?

YAML is a text format that is easy to read. Power Apps uses its own flavour of it to describe screens, controls and their properties. Copy a control in Power Apps Studio and paste it into a text editor, and you see its YAML. Paste YAML back into Studio, and it becomes controls again.

That makes YAML the fastest way to reuse UI in canvas apps: no component library to import, no solution to install. You paste text, and the controls are there, ready to edit like anything you built yourself.

Example: a button in Power Apps YAML

This is the complete YAML of the free Primary Button from PowerLibs, with its default settings. Copy it, select a screen in Power Apps Studio and press Ctrl+V.

- btnPrimary:
    Control: Classic/Button@2.2.0
    Properties:
      BorderColor: =RGBA(0, 0, 0, 0)
      BorderStyle: =BorderStyle.None
      BorderThickness: =0
      Color: =RGBA(255, 255, 255, 1)
      DisabledBorderColor: =RGBA(0, 0, 0, 0)
      DisabledColor: =RGBA(255, 255, 255, 1)
      DisabledFill: =ColorFade(RGBA(59, 130, 246, 1), 40%)
      Fill: =RGBA(59, 130, 246, 1)
      FocusedBorderThickness: =0
      Font: =Font.'Open Sans'
      FontWeight: =FontWeight.Semibold
      Height: =40
      HoverBorderColor: =RGBA(0, 0, 0, 0)
      HoverColor: =RGBA(255, 255, 255, 1)
      HoverFill: =ColorFade(RGBA(59, 130, 246, 1), -15%)
      OnSelect: |-
        =// Put your action here
        false
      PressedBorderColor: =RGBA(0, 0, 0, 0)
      PressedColor: =RGBA(255, 255, 255, 1)
      PressedFill: =ColorFade(RGBA(59, 130, 246, 1), -30%)
      RadiusBottomLeft: =10
      RadiusBottomRight: =10
      RadiusTopLeft: =10
      RadiusTopRight: =10
      Size: =11
      Text: ="Save changes"
      Width: =150
      X: =40
      Y: =40

Three rules you can see in it:

  • Every control starts with its name, here btnPrimary.
  • The Control line names the control type and its version, for example Classic/Button.
  • Every property value under Properties is a Power Fx formula and starts with =.

In the button library you can change the text, size, icon, brand color and theme, and the YAML follows.

How to paste YAML into Power Apps Studio

  1. Open your canvas app in Power Apps Studio.
  2. In the Tree view on the left, select the screen or the container that should get the controls.
  3. Press Ctrl+V (Cmd+V on a Mac), or open the ... menu of that screen and choose Paste.
  4. The first time, the browser asks whether make.powerapps.com may use the clipboard. Allow it.

YAML that starts with Screens: is a whole screen. It always arrives as a new screen of its own. The full walkthrough with screenshots is on Getting Started.

Why a YAML paste fails

Nothing happens on Ctrl+V

The browser has not allowed make.powerapps.com to read the clipboard. Allow it when asked, or turn it on in the site settings of your browser.

Only part of the code arrived

The copy was incomplete. YAML depends on indentation, so copy the whole block from the first line to the last.

A formula shows an error

Every formula value needs a leading = sign. Without it Power Apps reads the value as plain text.

A name is already taken

Two controls on one screen cannot share a name. Rename the old control or the pasted one.

A data source is missing

Some YAML points to a table or a SharePoint list. Add that data source to the app first.

More causes are in the FAQ.

Classic and Modern controls

Power Apps has two sets of controls, and the YAML differs between them. Classic controls (Classic/Button) have the most properties, so you can style them freely. Modern controls (Button, Text, TextInput) follow Microsoft's Fluent 2 design but expose fewer properties. Many PowerLibs components come in both versions, and you pick one when you copy the YAML. The details are in YAML Code Export.

Ready-made Power Apps YAML components

Writing YAML by hand works for a button. For a sidebar, a navigation bar or a whole app it takes hours. PowerLibs has 185 components and full apps as copy-paste YAML, in light and dark mode, in your brand color.

Generate Power Apps YAML with AI

AI assistants often write YAML that Power Apps Studio rejects. The PowerLibs MCP server gives Claude, Cursor or any other MCP client the library and the Power Apps YAML rules, so they generate code that pastes cleanly.

Set up the MCP server

Questions about Power Apps YAML

What is Power Apps YAML?

Power Apps YAML is the text format Power Apps Studio uses for screens, controls and their properties. When you paste it into Studio, it turns into real controls. It follows the YAML syntax, but with Power Apps rules on top: every control has a Control line with its type and version, and every formula starts with =.

How do I paste YAML code into Power Apps?

Open your canvas app in Power Apps Studio, select the screen or container in the Tree view and press Ctrl+V (Cmd+V on a Mac). You can also open the ... menu of that screen in the Tree view and choose Paste. Whole screens always arrive as a new screen.

Can I see the YAML of controls I built myself?

Yes. Copy a control in Power Apps Studio and paste it into a text editor: you get its YAML. That is a good way to learn the format and to move controls between apps.

Is there a Power Apps YAML code generator?

PowerLibs is one. Every component in the library has settings for text, colors, size and theme, and writes the matching YAML for you. With the PowerLibs MCP server, AI assistants like Claude or Cursor can also generate Power Apps YAML from a prompt.

Does the YAML work with Modern controls?

Yes. Many PowerLibs components come in a Classic and a Modern version. Classic controls have the most properties to style, Modern controls follow the Fluent 2 look.

Is PowerLibs free?

A free account can copy the YAML of 14 free components. The other components and the full apps need a paid plan.

Start with the free components

Create a free account and copy the YAML of 14 components into your app today.

Browse free components
Power Apps YAML Snippets and Code Generator | PowerLibs