Button Components, Variables and Variants
Add to favorites
Explore different button components, variables, and variants to enhance the functionality and aesthetics of your projects
Play video
Master No-Code Web Design with Framer
1
Complete Beginner-Friendly Framer Course
7:09
2
Create Your First Layout in Framer
13:47
3
Generate Layout with AI in Framer
7:26
4
Basic Layout and Interactive Elements
15:28
5
Text and Vector Animations
18:14
6
UI Design from Figma to Framer
13:16
7
Adaptive Layout with Stacks and Constraints in Framer
12:03
8
Responsive Layout with Breakpoints and Min Max
13:55
9
Button Components, Variables and Variants
11:01
10
Appear, Hover, Press, Loop and Drag Effects
11:17
11
Scroll Speed and Transform in Framer
15:15
12
Scroll Variants and Stick Element
12:13
13
Copy Components, Custom Cursors and 3D Embeds
10:00
14
Grid and Bento Layout
11:26
15
Icon Animation, Menu and Overlay
11:00
16
Code Components with Basic CSS
12:11
17
Property Controls in Framer
9:23
18
Code Overrides in Framer
13:23
19
CMS Collection Page and Detail
14:22
20
Search and Navigation
14:25
Create Button Component
Components in Framer are pre-built UI elements that can be easily customized and reused in your designs. Button components, for example, allow you to quickly create interactive buttons with various effects such as hover, click, and animation. These components help streamline your design process and ensure consistency throughout your project. With Framer's intuitive interface, creating and customizing button components is a breeze.
- Select the Glass Button and Create Component (Cmd + Option + K).
- In the Component, add a Hover state.
- Change the Shadow 0, 10, 40 to Opacity 30%.
- Change the Border Opacity to 50%.
- Set the Gap to 14 and Padding to 29 Left and Right.
- You can Test the Button directly in the Component by pressing Play.
Component Variables
Component variables in Framer are variables that are associated with a specific component. These variables can be used to customize and manipulate the behavior and appearance of the component. There are several types of variables that can be assigned to a component in Framer:
- Text: Text variables are used to store and manipulate text values. They can be used to display and modify text content within a component, such as labels, titles, descriptions, or user input.
- Color: Color variables are used to store and manipulate color values. They can be used to control the background color, text color, border color, and other visual properties of a component.
- Toggle: Toggle variables are used to store and control the state of a toggle switch or checkbox. They can be used to determine whether a toggle switch or checkbox is selected or deselected, and can be used to trigger certain actions or behaviors based on the toggle's state.
- Link: Link variables are used to store and manipulate URLs or references to other resources. They can be used to create clickable links or buttons that navigate to a different webpage or open a file or document.
- Component Properties: Component properties are variables that store and control various characteristics and behaviors of a component. They can include properties such as size, position, visibility, opacity, and many others.
By assigning values to these component variables, you can easily create dynamic and interactive components that respond to user interactions or change based on certain conditions. Framer provides a powerful and flexible way to define and use component variables, making it easy to create complex and customizable UI elements.
- Select the Product Button in the Navigation Menu and Create Component. Name it Button.
- Add a Border to White 0% Opacity and Create a Hover with the same Border at 20% Opacity.
- Select the Text and click on (+) Content to create a Variable. Set to Plain Text.
- Select the Variant and create a Link To Variable.
- Exit Component and duplicate (Cmd + D) the Button twice. Change the Text variable to Pricing and Changelog. Also, delete the non-component ones.
- Copy and Paste (Cmd + Shift + V) to replace the Log in one. Change text to Log in.
Component Variants
Button variants in Framer allow you to easily create multiple versions of a button with shared elements such as text, icons, sizes, and styles. This can be beneficial in situations where you need to display different variations of a button within your design.
Best practices for using button variants include organizing and labeling your variants in a clear manner, using nested components for more complex buttons, and utilizing Framer's built-in features such as states and interactions to enhance the functionality of your button variants.
- Copy and Paste the Button and replace the Sign up button. Change text to Sign up.
- Select the New components button and Right-click → Copy Style (Cmd + Option + C).
- Double-click the Sign up button and with Variant 1 selected, create a new Variant by clicking on the (+) to the right of it.
- Paste Style (Cmd + Option + V) to Variant 2.
- Create a Hover with Border White 25% and Shadow 0, 1, 22 to White 20%.
- Exit Component and in the Inspector, change from Variant 1 to Variant 2.
Nested Components
Just like in Figma, you can have Components inside Components with their own Variants and Variables. This is useful for smaller Components such as icons inside a button.
- Go to the Button Component.
- Insert a Feather Icon and set the Width and Height to 16, name to Chevron-right and Color white.
- Cut the Icon and Paste to Variant 1.
- Select Icon and create Variable for Visible (default No) and another Variable for Name.
- Exit Component.
- Copy and Paste the Sign up button to replace New components Button.
- Set Show Icon to Yes and change the text to New components.
Logo Component
Did you know that you can make the logo on your website link directly to the Home screen? It's a great way to make it easy for visitors to navigate back to the main page.
- Select the Logo and Create Component.
- Create a Hover state and set Opacity to 0.6.
Conclusion
In conclusion, button components are integral to user interface design as they allow users to interact with a system. These components are made up of variables and variants that determine their appearance and functionality. By utilizing button components in Framer, designers can easily create and customize interactive buttons with various effects. Component variables can be used to manipulate the behavior and appearance of the buttons, while component variants allow for the creation of multiple versions of a button with shared elements. Additionally, nested components can be used to incorporate smaller components, such as icons, within a button. By understanding and utilizing these features, designers can create intuitive and visually appealing user interfaces.
Templates and source code
Download source files
Download the videos and assets to refer and learn offline without interuption.
Design template
Source code for all sections
Video files, ePub and subtitles
Browse all downloads
1
Complete Beginner-Friendly Framer Course
4-hour free course to create beautiful, modern interfaces. Dark mode and glass designs, from Figma to Framer, using stack and grid layouts
7:09
2
Create Your First Layout in Framer
Master the basics of layout creation in Framer with this comprehensive step-by-step guide for beginners. Start building your designs today!
13:47
3
Generate Layout with AI in Framer
Create stunning websites with ease using Framer's AI-powered layout generator
7:26
4
Basic Layout and Interactive Elements
Learn how to create a user-friendly layout with interactive elements to enhance the user experience and engagement on your website or app
15:28
5
Text and Vector Animations
Transform your content with captivating text and vector animations
18:14
6
UI Design from Figma to Framer
Mastering the art of transitioning your UI design projects seamlessly from Figma to Framer with expert tips and techniques
13:16
7
Adaptive Layout with Stacks and Constraints in Framer
Create responsive designs easily using stacks and constraints in Framer. Perfect for adaptive layouts for web and mobile projects
12:03
8
Responsive Layout with Breakpoints and Min Max
Create a user-friendly website with responsive design, incorporating breakpoints and min-max values to ensure optimal display on all devices
13:55
9
Button Components, Variables and Variants
Explore different button components, variables, and variants to enhance the functionality and aesthetics of your projects
11:01
10
Appear, Hover, Press, Loop and Drag Effects
Mastering Framer Effects: Create interactive sites with Appear, Hover, Press, Loop, Drag Effects
11:17
11
Scroll Speed and Transform in Framer
Learn how to create dynamic Framer sites with advanced features for interactive designs
15:15
12
Scroll Variants and Stick Element
Enhance User Navigation with Sticky Elements and Scroll Variants in Framer
12:13
13
Copy Components, Custom Cursors and 3D Embeds
Learn how to incorporate Framer's interactive elements into your designs
10:00
14
Grid and Bento Layout
Enhancing Your Designs with Grid and Bento Layouts in Framer
11:26
15
Icon Animation, Menu and Overlay
Web Design User Experience with Icon Animation, Menus, and Overlays in Framer
11:00
16
Code Components with Basic CSS
Create Basic Code Components with CSS in Framer
12:11
17
Property Controls in Framer
Mastering Property Controls for Interactive Framer Components
9:23
18
Code Overrides in Framer
Enhancing Your Framer Elements with Code Overrides
13:23
19
CMS Collection Page and Detail
Integrating Figma Designs with Framer and CMS
14:22
20
Search and Navigation
Enhancing User Experience: Search, Navigation, and Footer Integration
14:25
Meet the instructor
We all try to be consistent with our way of teaching step-by-step, providing source files and prioritizing design in our courses.
Meng To
I design, code and write
Meng To is the author of Design+Code. Meng started off his career as a self-taught designer from Montreal and eventually traveled around the world for 2 years as his US VISA was denied. During his travels, he wrote a book which now has 35,000 readers.
39 courses - 183 hours
Build SwiftUI apps for iOS 18 with Cursor and Xcode
In this course, we'll explore the exciting new features of SwiftUI 6 and Xcode 16 for building iOS 18 apps. From mesh gradients and text animations to ripple effects, you'll learn how to create polished, highly custom apps using the latest workflows. We'll also dive into using Cursor and Claude AI for AI-driven coding, helping you start strong and customize your apps.
5 hrs
Create your Dream Apps with Cursor and Claude AI
Learn to build your dream web apps from the ground up using Cursor, Claude AI, and a suite of powerful AI tools. This course covers everything you need, including React for frontend development, Firebase for backend integration, and Stripe for handling payments. You’ll also dive into advanced AI tools like Claude Artifacts, Galileo AI, v0.dev for UI, Ideogram for design generation, and Cursor Composer for full-scale development.
5 hrs
Build a React Site from Figma to Codux
In this course, you'll learn to build a website from scratch using Codux, starting with a Figma template. You’ll master responsive design, collaborate with developers on a real React project, export CSS from Figma using Locofy, set up breakpoints with media queries, add CSS animations, improve SEO, create multiple pages with React Router, and publish your site. By following best practices, you’ll bridge design and development, improve your web design skills.
2 hrs
Create 3D UI for iOS and visionOS in Spline
Comprehensive 3D Design Course: From Basics to Advanced Techniques for iOS and visionOS using SwiftUI
3 hrs
Master No-Code Web Design with Framer
In this free Framer course, you'll learn to create modern, user-friendly interfaces. Start with dark mode and glass designs, then move from Figma to Framer, using vectors and auto layout for responsive websites. Add animations, interactive buttons, and custom components with code. Finally, you'll craft a design system suitable for teamwork or solo projects, all in a straightforward and practical approach.
4 hrs
Build SwiftUI Apps for iOS 17
In this course, we’ll be exploring the fresh and exciting features of SwiftUI 5! As we craft a variety of iOS apps from the ground up, we'll delve deep into the treasure trove that is SwiftUI's user interface, interactions, and animations.
4 hrs
Build Beautiful Apps with GPT-4 and Midjourney
Design and develop apps using GPT-4 and Midjourney with prompts for SwiftUI, React, CSS, app concepts, icons, and copywriting
4 hrs
Build SwiftUI apps for iOS 16
Create animated and interactive apps using new iOS 16 techniques using SwiftUI 4 and Xcode 14
5 hrs
Build a 3D Site Without Code with Framer
Design and publish a responsive site with 3D animation without writing a single line of code
3 hrs
Create 3D Site with Spline and React
Design and code a landing page with an interactive 3D asset using Spline and CodeSandbox
1 hrs
Build an Animated App with Rive and SwiftUI
Design and code an iOS app with Rive animated assets, icon animations, custom layouts and interactions
3 hrs
Build a SwiftUI app for iOS 15 Part 3
Design and code a SwiftUI 3 app with custom layouts, animations and gestures using Xcode 13, SF Symbols 3, Canvas, Concurrency, Searchable and a whole lot more
4 hrs
Build a SwiftUI app for iOS 15 Part 2
Design and code a SwiftUI 3 app with custom layouts, animations and gestures using Xcode 13, SF Symbols 3, Canvas, Concurrency, Searchable and a whole lot more
3 hrs
Build a SwiftUI app for iOS 15
Design and code a SwiftUI 3 app with custom layouts, animations and gestures using Xcode 13, SF Symbols 3, Canvas, Concurrency, Searchable and a whole lot more
4 hrs
React Livestreams
Learn how we can use React Hooks to build web apps using libraries, tools, apis and frameworks
4 hrs
Design Founder Livestreams
A journey on how we built DesignCode covering product design, management, analytics, revenue and a good dose of learning from our successes and failures
2 hrs
SwiftUI Advanced Handbook
An extensive series of tutorials covering advanced topics related to SwiftUI, with a main focus on backend and logic to take your SwiftUI skills to the next level
4 hrs
iOS Design Handbook
A complete guide to designing for iOS 14 with videos, examples and design files
2 hrs
SwiftUI Handbook
A comprehensive series of tutorials covering Xcode, SwiftUI and all the layout and development techniques
7 hrs
Build a web app with React Hooks
Learn how we built the new Design+Code site with React Hooks using Gatsby, Netlify, and advanced CSS techniques with Styled Components.
4 hrs
UI Design Handbook
A comprehensive guide to the best tips and tricks for UI design. Free tutorials for learning user interface design.
2 hrs
Figma Handbook
A comprehensive guide to the best tips and tricks in Figma
6 hrs
SwiftUI for iOS 14
Build a multi-platform app from scratch using the new techniques in iOS 14. We'll use the Sidebar and Lazy Grids to make the layout adaptive for iOS, iPadOS, macOS Big Sur and we'll learn the new Matched Geometry Effect to create beautiful transitions between screens without the complexity. This course is beginner-friendly and is taught step-by-step in a video format.
3 hrs
SwiftUI Livestreams
This is a compilation of the SwiftUI live streams hosted by Meng. Over there he talks and teaches how to use design systems, typography, navigation, iOS 14 Design, prototyping, animation and Developer Handoff.
19 hrs
UI Design Livestreams
This is a compilation of the UI live streams hosted by Meng. Over there he talks and teaches how to use design systems, typography, navigation, iOS 14 Design, prototyping, animation and Developer Handoff.
26 hrs
UI Design for Developers
In this course we'll learn how to use design systems, set up break points, typography, spacing, navigation, size rules for adapting to the iPad, mobile and web versions, and different techniques that translate well from design to code.
3 hrs
Build an app with SwiftUI Part 3
This course was written for designers and developers who are passionate about design and about building real apps for iOS, iPadOS, macOS, tvOS and watchOS. SwiftUI works across all of those platforms. While the code is not a one-size-fits-all, the controls and techniques involved can apply to all platforms. It is beginner-friendly, but it is also packed with design tricks and cool workflows about building the best UIs and interactions.
4 hrs
Build an app with SwiftUI Part 2
This course was written for designers and developers who are passionate about design and about building real apps for iOS, iPadOS, macOS, tvOS and watchOS. SwiftUI works across all of those platforms. While the code is not a one-size-fits-all, the controls and techniques involved can apply to all platforms. It is beginner-friendly, but it is also packed with design tricks and cool workflows about building the best UIs and interactions.
4 hrs
Build a full site in Webflow
Webflow is a design tool that can build production-ready experiences without code. You can implement CSS-driven adaptive layouts, build complex interactions and deploy all in one tool. Webflow also comes with a built-in content management system (CMS) and Ecommerce for creating a purchase experience without the need of third-party tools.
3 hrs
Advanced Prototyping in ProtoPie
ProtoPie is a cross-platform prototyping tool that creates prototypes nearly as powerful as those made with code, with half of the efforts, and zero code. It's perfect for designers who want to quickly experiment with advanced interactions using variables, conditions, sensors and more.
3 hrs
Build an app with SwiftUI Part 1
This course was written for designers and developers who are passionate about design and about building real apps for iOS, iPadOS, macOS, tvOS and watchOS. SwiftUI works across all of those platforms. While the code is not a one-size-fits-all, the controls and techniques involved can apply to all platforms. It is beginner-friendly, but it is also packed with design tricks and cool workflows about building the best UIs and interactions.
4 hrs
React Native for Designers Part 2
React Native is a popular Javascript framework that builds on top of React by using native components to create a real mobile app indistinguishable from one made using Xcode or Android Studio. The main difference with native development is that you get to use CSS, hot-reload, Javascript and other familiar techniques that the Web has grown over the past decades. Most importantly, you're building for both iOS and Android using the same codebase.
3 hrs
React Native for Designers
React Native is a popular Javascript framework that builds on top of React by using native components to create a real mobile app indistinguishable from one made using Xcode or Android Studio. The main difference with native development is that you get to use CSS, hot-reload, Javascript and other familiar techniques that the Web has grown over the past decades. Most importantly, you're building for both iOS and Android using the same codebase.
5 hrs
Design System in Figma
Learn how to use and design a collaborative and powerful design system in Figma. Design Systems provide a shared library of reusable components and guidelines and that will let you build products much faster
3 hrs
React for Designers
Learn how to build a modern site using React and the most efficient libraries to get your site/product online. Get familiar with Grid CSS, animations, interactions, dynamic data with Contentful and deploying your site with Netlify.
3 hrs
Swift Advanced
Learn Swift a robust and intuitive programming language created by Apple for building apps for iOS, Mac, Apple TV and Apple Watch
9 hrs
Learn Swift
Learn Swift a robust and intuitive programming language created by Apple for building apps for iOS, Mac, Apple TV and Apple Watch
4 hrs
Learn Sketch
Learn Sketch a design tool entirely vector-based and focused on user interface design
5 hrs
Learn iOS 11 Design
Learn colors, typography and layout for iOS 8
1 hrs