Close Menu
    DevStackTipsDevStackTips
    • Home
    • News & Updates
      1. Tech & Work
      2. View All

      Full-Stack Techies vs Toptal: Which Is Better for React.js Outsourcing?

      July 3, 2025

      The AI productivity paradox in software engineering: Balancing efficiency and human skill retention

      July 2, 2025

      The impact of gray work on software development

      July 2, 2025

      CSS Intelligence: Speculating On The Future Of A Smarter Language

      July 2, 2025

      Your Roku has secret menus and screens – here’s how to unlock them

      July 3, 2025

      Add Paramount+, STARZ, and more to your Prime Video account for $0.99 a month – here’s how

      July 3, 2025

      My new favorite keychain accessory gives me 2TB of SSD storage instantly

      July 3, 2025

      HP’s latest OmniBook finally sold me on the 2-in-1 form factor (and it’s on sale)

      July 3, 2025
    • Development
      1. Algorithms & Data Structures
      2. Artificial Intelligence
      3. Back-End Development
      4. Databases
      5. Front-End Development
      6. Libraries & Frameworks
      7. Machine Learning
      8. Security
      9. Software Engineering
      10. Tools & IDEs
      11. Web Design
      12. Web Development
      13. Web Security
      14. Programming Languages
        • PHP
        • JavaScript
      Featured

      Simplifying Stream Handling with Laravel’s resource Method

      July 3, 2025
      Recent

      Simplifying Stream Handling with Laravel’s resource Method

      July 3, 2025

      Intelligent Parsing and Formatting of Names in PHP Applications

      July 3, 2025

      This Week in Laravel: Cursor Rules, Nightwatch Review, and Race Conditions

      July 3, 2025
    • Operating Systems
      1. Windows
      2. Linux
      3. macOS
      Featured

      Microsoft confirms Windows 11 KB5060829 issues, but you can safely ignore it

      July 3, 2025
      Recent

      Microsoft confirms Windows 11 KB5060829 issues, but you can safely ignore it

      July 3, 2025

      Hash Calculator – calculates around 50 cryptographic hashes of strings and files

      July 3, 2025

      Rilasciato Thunderbird 140 ESR: Un’attenzione alle esigenze aziendali

      July 3, 2025
    • Learning Resources
      • Books
      • Cheatsheets
      • Tutorials & Guides
    Home»Development»Canvas App Components: A Crash Course for Power Apps Developers

    Canvas App Components: A Crash Course for Power Apps Developers

    May 17, 2025

    If you have experience in traditional software development, low-code tools may feel a bit sparse at first. But to many people’s surprise, traditional techniques often translate quite well to low-code development. Not always one-for-one – but usually close enough.

    One of the most fundamental tasks when building an application is breaking it down into its core parts, or components. Websites are constructed from smaller building blocks. Just how small? Well, that’s up to you, the developer.

    In the example below, we can spot some obvious elements: a header, a search box, perhaps a sidebar for navigation, and a main content area. Applications emerge from many smaller parts coming together.

    Image of components of a website

    Components allow us to isolate responsibility and manage complexity for specific parts of an application. In both traditional and low-code development, they play a vital role in creating maintainable, reusable, and testable products.

    In this article, you’ll learn what a component is. Then we’ll build a custom text field component inside a Canvas app.

    Prerequisites

    This tutorial assumes a basic understanding of Microsoft Power Apps. While not required to understand the article, to actively follow along, you’ll need access to a Power Platform environment with the App Maker security role.

    Table of Contents

    • The Concept of a Component

    • How to Build Your Own Component

    • Wrapping Up

    The Concept of a Component

    The idea of components isn’t new – and it’s not exclusive to software.

    Let’s think about a car for a moment. A car is made up of many smaller parts: wheels, an engine, seats, a steering wheel, and so on. But it’s the concept of the car – and specifically its ability to transport us – that provides value. That concept emerges from the way the individual parts work together.

    Now imagine you get a flat tire. Not a good day. But thanks to how cars are designed, you don’t need a whole new car – maybe not even a new tire. You fix the issue and you’re back on the road within a few hours. Breaking things into smaller parts helps make the whole system more resilient. Applying this same principle to application development is a smart, future-proof approach.

    Two Broad Types of Components

    Within an application, components can vary in complexity and responsibility. Some are simple, like a text label. Others are more complex, like a pop-up dialog. Regardless of their complexity (again, your design choice), components typically fall into one of two categories:

    • Presentational (“Dumb”) Components

    • Container (“Smart”) Components

    The difference comes down to purpose. A container component may interact with external sources and usually mutates state. A presentational component, on the other hand, is generally only responsible for how things look and light communication with the application.

    Container components are often more complex and harder to test. Presentational components are typically simpler and more predictable.

    This isn’t to say you should avoid container components. That’s not realistic. At some point, your app will need to talk to the outside world.

    Aside: Pure Functions

    The concept of pure functions is useful here.

    A function is considered pure if it always returns the same output for the same input and doesn’t interact with any external state.

    // Example 1 (pure)
    function add(x, y) {
      return x + y;
    }
    
    console.log(add(2, 3)); // Always 5
    
    // Example 2 (not pure)
    function subtract(x) {
      const y = Math.floor(Math.random() * 100) + 1; // Random number between 1 - 100
      console.log(y);
      return x + y;
    }
    
    console.log(subtract(5)); // Unpredictable
    

    Just like add() is pure and subtract() is not, a presentational component behaves like a pure function: same input, same output. The output might be how the UI appears or an event with associated data.

    More About Inputs and Outputs

    If you’ve built a Canvas App before, you’ve already used components – even if you didn’t realize it. Most controls in a Canvas App are presentational components.

    Take the Label control. It receives an input (Text) and renders output (the text on screen).

    Image of Canvas App label

    Events are another kind of output. For example, the Button control emits an event when clicked – handled through the OnSelect property. That property allows the app to respond to the click and perform some logic.

    Image of Canvas app button

    💡 When a component sends a message back to the application the component is said to have emitted an event.

    Now let’s look at the Text Input control.

    Like the others, it has inputs (like Placeholder). But it also emits a Change event via OnChange. Even better, it passes data back to the application through its Value property. As the user types, the value updates. That value is how we access what they typed.

    Image of Canvas app text input

    How to Build Your Own Component

    Let’s build a simple, customized input component. It will include:

    • A label above the input

    • Optional “required” validation

    • Change detection and data output

    Here is what it will look like:

    Image of custom text field to be built

    Part 1: Create the Component

    1. Navigate to the Components section of your Canvas App.

    2. Add a new component and name it cmp_baseInput.

    3. Resize it to 340 (w) x 100 (h).

    Image of how to create a component

    Part 2: Add Controls

    1. Add a Text Input control, centered.

    2. Add two Labels—one above, one below the input.

    3. Rename them:

      • lbl_label

      • lbl_hint

      • txt_textField

    Image of the appropriate controls added to the component

    Part 3: Add Custom Properties

    Add four properties to the component. We’re primarily concerned with the Property Type, Property Definition, and Data Type properties.

    • IsRequired (Data, Input, Boolean)

    • Label (Data, Input, Text)

    • Value (Data, Output, Text)

    • OnChange (Event)

    Image of custom properties added to the component

    Part 4: Connect the Properties

    Set the control’s properties as follows.

    lbl_label.Text = cmp_baseInput.Label
    
    lbl_hint.Text = "This field is required."
    lbl_hint.Visible = cmp_baseInput.IsRequired And Len(txt_textField.Value) < 1
    
    txt_textField.OnChange = cmp_baseInput.OnChange()
    
    cmp_baseInput.Value = txt_textField.Value
    cmp_baseInput.Label = "Placeholder Label"
    

    Part 5: Style It

    lbl_label.Size = 12
    lbl_label.Height = 24
    lbl_label.FontColor = RGBA(122, 138, 143, 1)
    
    lbl_hint.Size = 10
    lbl_hint.Height = 24
    lbl_hint.FontColor = RGBA(215, 58, 60, 1)
    lbl_hint.FontWeight = 'TextCanvas.Weight'.Semibold
    

    Part 6: Add It to the App

    1. Go back to the application screen.

    2. Insert the component and name it cmp_userName.

    3. Add a label nearby and set its text to:
      "The user name is: " & cmp_userName.Value

    Image of inserting the component in the application

    Image of the component inserted into the application

    Part 7: Test It

    • Type in the component and click outside of it → label near the component updates and the hint disappears.

    • Clear the text → hint reappears

    • Set IsRequired to false → hint disappears

    • Set OnChange to Notify("A change occurred!") and type in the input→ a toast message appears with you notification.

    Wrapping Up

    You’ve just created a functional, presentational component. It handles labels, validation, value output, and even events – all in one package.

    This is the real power of components: abstraction, clarity, and reusability. Whether you’re in a traditional or low-code environment, thinking in components helps you break complexity into manageable parts.

    As your apps grow, this mindset will pay off. You’ll spend less time rewriting logic and more time building value – one well-defined part at a time.

    Enjoyed this article? I write regularly about low-code, development patterns, and practical tech topics at scriptedbytes.com

    Stay curious and keep building.

    Source: freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More 

    Facebook Twitter Reddit Email Copy Link
    Previous ArticleI’m a TV expert and these are my favorite Memorial Day TV deals: Save up to $2,500 on Sony, Samsung, and more
    Next Article How to Write Math Equations in Google Docs

    Related Posts

    Common Vulnerabilities and Exposures (CVEs)

    CVE-2025-23968 – WPCenter AiBud WP Unrestricted File Upload RCE

    July 3, 2025
    Common Vulnerabilities and Exposures (CVEs)

    CVE-2025-45809 – BerriAI litellm SQL Injection Vulnerability

    July 3, 2025
    Leave A Reply Cancel Reply

    For security, use of Google's reCAPTCHA service is required which is subject to the Google Privacy Policy and Terms of Use.

    Continue Reading

    CVE-2025-6287 – PHPGurukul COVID19 Testing Management System Cross Site Scripting Vulnerability

    Common Vulnerabilities and Exposures (CVEs)

    Linus Torvalds torna alla tastiera meccanica: il valore del feedback nella digitazione per chi sviluppa

    Linux

    2023: A Year of Groundbreaking Advances in AI and Computing

    Artificial Intelligence

    LLMs Struggle to Act on What They Know: Google DeepMind Researchers Use Reinforcement Learning Fine-Tuning to Bridge the Knowing-Doing Gap

    Machine Learning

    Highlights

    Development

    How to Build Your First Website in 10 Minutes (No Coding Required)

    June 22, 2025

    Building a website might seem like a daunting task, especially if you have no experience with coding. But thanks to modern website builders, you can create a stunning, fully functional website in just 10 minutes. Whether you want a personal blog, an online portfolio, or a small business site, this guide will walk you through the process step by step—no technical skills required!Step 1: Choose a Website BuilderWebsite builders are platforms that make it easy to design, customize, and publish websites without needing to write a single line of code. Here are some popular options:Wix: Best for beginners with drag-and-drop functionality.Squarespace: Great for sleek, professional designs.WordPress.com: Excellent for bloggers and content-heavy sites.Shopify: Ideal for e-commerce websites.Tip: Choose a builder that aligns with your website’s purpose. For this tutorial, we’ll use Wix for its user-friendly interface and variety of templates.Step 2: Sign Up and Pick a TemplateSign Up: Go to the website builder’s homepage and create a free account. Enter your email and a password to get started.Pick a Template: After signing up, you’ll be prompted to choose a template. Templates are pre-designed layouts that act as a foundation for your website.Browse categories like “Portfolio,” “Blog,” or “Business.”Select a design that suits your style and purpose.Example: If you’re starting a photography portfolio, look for a template with a clean design and image galleries.Step 3: Customize Your WebsiteNow comes the fun part—customizing your site to make it uniquely yours.Edit Text: Click on any text box to replace the default text with your own. Add your name, business info, or a catchy tagline.Add Images: Upload your own photos or choose from the builder’s stock image library. Drag and drop images into place.Change Colors and Fonts: Most builders allow you to customize colors and fonts to match your branding.Add Pages: Need more than a homepage? Add additional pages like “About,” “Services,” or “Contact” with just a click.Tip: Keep your design clean and straightforward. Too many elements can make your site look cluttered.Step 4: Add Essential FeaturesMake your website functional by integrating essential features:Contact Form: Allow visitors to reach you easily. Drag and drop a contact form onto your page and customize the fields.Social Media Links: Add clickable icons that link to your social profiles.SEO Settings: Optimize your site for search engines by adding keywords to your page titles and descriptions.Mobile Optimization: Check how your site looks on mobile devices and make adjustments if needed.Example: Add a “Subscribe” button to collect email addresses for your newsletter.Step 5: Preview and PublishPreview Your Site: Before publishing, use the preview option to see how your site will appear to visitors. Look for any typos, broken links, or design issues.Publish: Once you’re satisfied, hit the “Publish” button. Your site is now live and accessible to the world!Get a Custom Domain: While most website builders offer free domains (e.g., yoursite.wixsite.com), upgrading to a custom domain (e.g., yoursite.com) gives your site a professional touch.Tip: Promote your site by sharing the link on social media or through email.Step 6: Keep ImprovingBuilding your website is just the beginning. To keep it fresh and engaging:Regularly update your content.Add new pages or blog posts.Analyze visitor data using tools like Google Analytics.Upgrade to premium plans for advanced features like e-commerce or ad-free hosting.Final ThoughtsCreating a website has never been easier. With a little time and creativity, you can have your own corner of the internet up and running in just 10 minutes. Whether it’s for personal or professional use, your website is a reflection of you—so make it count!

    CVE-2025-5621 – D-Link DIR-816 OS Command Injection Vulnerability

    June 4, 2025

    Accessibility vs. Inclusive Design vs. Universal Design: Understanding the Differences

    June 10, 2025

    CVE-2025-46204 – Apache Unifiedtransform Privilege Escalation Vulnerability

    June 4, 2025
    © DevStackTips 2025. All rights reserved.
    • Contact
    • Privacy Policy

    Type above and press Enter to search. Press Esc to cancel.