Loading...

How to build a split button component for Power Apps

How to build a split button component for Power Apps

tl;dr

Less controls mean less user confusion and better performance - This blog post guides you through the creation of a simple yet effective split button component.

splitbutton walkthrough

Let’s create a component

  1. Create a new canvas component cmp_SplitButton and add the following custom properties to it
    property type default
    splitButtonHeight Number 40
    splitButtonWidth Number 196
    primaryColor Color ColorValue("#1e6091")
    secondaryColor Color ColorValue("#168aad")
    textColor Color White
    buttonText Text "open"
    Onchange Behavior(Text) (needs boolean parameter called option)
    Onselect Behavior(Boolean) true

custom properties

  1. Add a button btn_main to the component
  2. Set its OnSelect property to cmp_SplitButton.Onselect() - this will make sure that when we later call that function we will return a true so that we can determine in our app if that button was selected.
  3. Now let’s refer to our custom properties:
    property value
    BorderColor Self.Fill
    Color cmp_SplitButton.textColor
    Fill cmp_SplitButton.primaryColor
    Height cmp_SplitButton.splitButtonHeight
    HoverBorderColor cmp_SplitButton.secondaryColor
    HoverColor Self.Color
    HoverFill cmp_SplitButton.secondaryColor
    PressedBorderColor cmp_SplitButton.secondaryColor
    PressedColor Self.Color
    PressedFill cmp_SplitButton.secondaryColor
    Radius 0
    Width cmp_SplitButton.splitButtonWidth-36
  4. Add a dropdown control drp_options to the component and refer as follows to our custom properties:
property value
BorderColor cmp_SplitButton.primaryColor
ChevronBackground cmp_SplitButton.primaryColor
ChevronFill cmp_SplitButton.textColor
ChevronHoverBackground cmp_SplitButton.secondaryColor
ChevronHoverFill cmp_SplitButton.textColor
HoverBorderColor cmp_SplitButton.secondaryColor
Color cmp_SplitButton.secondaryColor
Fill White
Height cmp_SplitButton.splitButtonHeight+2
HoverBorderColor cmp_SplitButton.secondaryColor
HoverColor cmp_SplitButton.textColor
HoverFill cmp_SplitButton.secondaryColor
PressedBorderColor cmp_SplitButton.secondaryColor
PressedColor cmp_SplitButton.textColor
PressedFill cmp_SplitButton.secondaryColor
SelectionColor cmp_SplitButton.textColor
SelectionFill cmp_SplitButton.secondaryColor
Width cmp_SplitButton.splitButtonWidth+2

I know, that is a tedious task, but trust me, the result looks good.

  1. Set the Items property to any array that you like - I used ["open in SharePoint", "open in Teams", "send as an email"]
  2. Now let’s take of functionality of the dropdown - set the OnChange property to cmp_SplitButton.Onchange(drp_options.SelectedText.Value).

Add Functionality to your component

Depending on your use case, you will want to at least

  1. determine, if the button has been selected (to then perform other actions)
  2. determine, which value has been selected in the dropdown.

To achieve this,

  1. Add your component to the app
  2. Set the Onselect (custom) property to UpdateContext({loc_isButtonClicked:true}) - which saves a True value in local variable to determine if that button was clicked.
  3. Set the Onchange (custom) property to UpdateContext({loc_selectedOption: option}) - this way you set a local variable to the Selected Text of your dropdown

variables

Why is this better than a dropdown menu and a separate button?

We aim to deliver clean, consistent, and intuitive user experiences - and in cases where we want users to perform a main action or where its likely that one action is the most important action on a screen, we want to make that obvious to them. However sometimes, there are similar actions that can be performed as well - and then such a split button comes in handy. This design pattern is a great way to reduce visual clutter and provide a good user experience.

splitbutton

Feedback and what’s next?

I am curious - do you use split buttons as well? What are your use cases>? Let me know on twitter :-) If you found this blog post useful, please also subscribe to my newsletter - news coming about every 2 months, I promise to not spam you!

Published on:

Learn more
Luise Freese: Consultant & MVP
Luise Freese: Consultant & MVP

Recent content on Luise Freese: Consultant & MVP

Share post:

Related posts

Power Apps vs Traditional App Development: Is Low-Code Winning in 2026?

Introduction For decades, businesses relied on traditional software development to build custom applications. Every feature required months of...

10 hours ago

Top 10 New Features in Microsoft Power Apps You Can’t Ignore in 2026

The low-code revolution is evolving faster than ever, and Microsoft Power Apps continues to lead the way. With artificial intelligence becomin...

10 hours ago

The Best Way to Learn Power Apps, Power Automate & Microsoft Copilot in 2026

Looking for the best live training to master the Microsoft Power Platform? PowerApps911's live, Microsoft MVP-led courses are designed to help...

15 hours ago

How AI Agents Are Transforming Microsoft Power Apps in 2026: The Future of Intelligent Business Applications

The world of business application development is undergoing a revolutionary transformation. What once required teams of software developers, m...

2 days ago

Power Automate – Build better forms with integrated Power Apps

We are announcing the ability to launch interactive Power Apps directly from desktop flows within Power Automate. This feature will reach gene...

6 days ago

AI-Assisted Power Apps Code App Development Using GitHub Copilot CLI

Power Apps Code Apps bring modern web application development into the Power Platform ecosystem by combining React-based applications with Dat...

7 days ago

Replacing Canvas Apps with Code Apps

Power Platform offers several different ways to build apps with AI. I particularly like code apps. But how do you get started? One great way t...

13 days ago

Build a Power Apps MCP App for Microsoft 365 Copilot

In this post we build a small MCP App on a Power Apps model-driven app (MDA). The app exposes one custom tool that generates a 5-color palette...

14 days ago
Stay up to date with latest Microsoft Dynamics 365 and Power Platform news!
* Yes, I agree to the privacy policy