Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Free Learning
Arrow right icon
React Material-UI Cookbook
React Material-UI Cookbook

React Material-UI Cookbook: Build captivating user experiences using React and Material-UI

eBook
€17.99 €26.99
Paperback
€32.99
Subscription
Free Trial
Renews at €18.99p/m

What do you get with a Packt Subscription?

Free for first 7 days. $19.99 p/m after that. Cancel any time!
Product feature icon Unlimited ad-free access to the largest independent learning library in tech. Access this title and thousands more!
Product feature icon 50+ new titles added per month, including many first-to-market concepts and exclusive early access to books as they are being written.
Product feature icon Innovative learning tools, including AI book assistants, code context explainers, and text-to-speech.
Product feature icon Thousands of reference materials covering every tech concept you need to stay up to date.
Subscribe now
View plans & pricing
Table of content icon View table of contents Preview book icon Preview Book

React Material-UI Cookbook

App Bars - The Top Level of Every Page

In this chapter, you'll learn about the following recipes:

  • Fixed position
  • Hide on scroll
  • Toolbar abstraction
  • With navigation

Introduction

App Bars are the anchor point of any Material-UI application. They provide context and are usually always visible as the user navigates around the application.

Fixed position

You probably want your AppBar component to stay visible at all times. By using fixed positioning, AppBar components remain visible even as the user scrolls down the page.

How to do it...

You can use the fixed value of the position property. Here's how you do it:

import React from 'react';

import { withStyles } from '@material-ui/core/styles';
import AppBar from '@material-ui/core/AppBar';
import Toolbar from '@material-ui/core/Toolbar';
import Typography from '@material-ui/core/Typography';
import Button from '@material-ui/core/Button';
import IconButton from '@material-ui/core/IconButton';
import MenuIcon from '@material-ui/icons/Menu...

Hide on scroll

If you have a lot of content on your screen that requires the user to scroll vertically, the App Bar could be a distraction. One solution is to hide the AppBar component while the user is scrolling down.

How to do it...

To hide the AppBar component while the user is scrolling down, you have to know when the user is scrolling. This requires listening to the scroll event on the window object. You can implement a component that listens to this event and hides the AppBar component while scrolling. Here's how it's done:

import React, { Component } from 'react';
import { withStyles } from '@material-ui/core/styles';
import AppBar from '@material-ui/core/AppBar';
import Toolbar...

Toolbar abstraction

Toolbar code can get verbose if you have to render toolbars in several places. To address this, you can create your own Toolbar component that encapsulates the content patterns of toolbars, making it easier to render AppBar components in several places.

How to do it...

Let's assume that your app renders AppBar components on several screens. Each AppBar component also renders Menu and title to the left, as well as Button to the right. Here's how you can implement your own AppBar component so that it's easier to use on several screens:

import React, { Fragment, Component } from 'react';

import { withStyles } from '@material-ui/core/styles';
import AppBar from '@material...

With navigation

Material-UI apps are typically made up of several pages that are linked together using a router, such as react-router. Each page renders an App Bar that has information specific to that page. This is one example of when the abstraction that you created in the Toolbar abstraction recipe comes in handy.

How to do it...

Let's say that you're building an app that has three pages. On each page, you want to render an App Bar with the title prop of the page. Furthermore, the menu in the App Bar should contain links to the three pages. Here's how to do it:

import React, { Fragment, Component } from 'react';
import {
BrowserRouter as Router,
Route,
Link
} from 'react-router-dom';

import...
Left arrow icon Right arrow icon
Download code icon Download Code

Key benefits

  • Use React components to build intuitive UI elements
  • Explore a variety of styles and themes in the Material-UI framework using React components
  • Learn practical React recipes and best practices for building modern web applications

Description

Material-UI is a component library for rendering UI elements, using modern best practices from React and Material Design. This book will show you how you can create impressive and captivating modern-day web apps by implementing Material Design considerations. The book is designed to help you use a variety of Material-UI components to enhance UI functionality, along with guiding you through React best practices, and using state, context, and other new React 16.8 features. You will start with layout and navigation, exploring the Grid component and understanding how it’s used to build layouts for your Material-UI apps. Using Material-UI components, you’ll then explore the technique of effectively presenting information. In later sections, you will also learn about the different components for user interactions such as the text input component and buttons. Finally, the book will get you up to speed with customizing the look and feel of your app, right from creating a Material-UI theme through to styling icons and text. By the end of this book, you will have developed the skills you need to improve the look and feel of your applications using Material-UI components.

Who is this book for?

This book is for React developers who want to implement Material Design principles in their applications. You will also find this book helpful if you are a developer who wants to build a UI using React components without having to build your own UX framework.

What you will learn

  • Build the overall structure and navigation for your Material-UI app
  • Present simple and complex information in a variety of ways
  • Develop interactive and intuitive controls
  • Group content into sections using tabs and expansion panels
  • Create a general page layout with Material-UI grids
  • Use lists for complex data, and cards for detailed information

Product Details

Country selected
Publication date, Length, Edition, Language, ISBN-13
Publication date : Mar 30, 2019
Length: 534 pages
Edition : 1st
Language : English
ISBN-13 : 9781789615227
Vendor :
Facebook
Languages :

What do you get with a Packt Subscription?

Free for first 7 days. $19.99 p/m after that. Cancel any time!
Product feature icon Unlimited ad-free access to the largest independent learning library in tech. Access this title and thousands more!
Product feature icon 50+ new titles added per month, including many first-to-market concepts and exclusive early access to books as they are being written.
Product feature icon Innovative learning tools, including AI book assistants, code context explainers, and text-to-speech.
Product feature icon Thousands of reference materials covering every tech concept you need to stay up to date.
Subscribe now
View plans & pricing

Product Details

Publication date : Mar 30, 2019
Length: 534 pages
Edition : 1st
Language : English
ISBN-13 : 9781789615227
Vendor :
Facebook
Languages :

Packt Subscriptions

See our plans and pricing
Modal Close icon
€18.99 billed monthly
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Simple pricing, no contract
€189.99 billed annually
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just €5 each
Feature tick icon Exclusive print discounts
€264.99 billed in 18 months
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just €5 each
Feature tick icon Exclusive print discounts

Frequently bought together


Stars icon
Total 102.97
React Design Patterns and Best Practices
€32.99
React Cookbook
€36.99
React Material-UI Cookbook
€32.99
Total 102.97 Stars icon
Banner background image

Table of Contents

21 Chapters
Grids - Placing Components on the Page Chevron down icon Chevron up icon
App Bars - The Top Level of Every Page Chevron down icon Chevron up icon
Drawers - A Place for Navigation Controls Chevron down icon Chevron up icon
Tabs - Grouping Content into Tab Sections Chevron down icon Chevron up icon
Expansion Panels - Group Content into Panel Sections Chevron down icon Chevron up icon
Lists - Display Simple Collection Data Chevron down icon Chevron up icon
Tables - Display Complex Collection Data Chevron down icon Chevron up icon
Cards - Display Detailed Information Chevron down icon Chevron up icon
Snackbars - Temporary Messages Chevron down icon Chevron up icon
Buttons - Initiating Actions Chevron down icon Chevron up icon
Text - Collecting Text Input Chevron down icon Chevron up icon
Autocomplete and Chips - Text Input Suggestions for Multiple Items Chevron down icon Chevron up icon
Selection - Make Selections from Choices Chevron down icon Chevron up icon
Pickers - Selecting Dates and Times Chevron down icon Chevron up icon
Dialogs - Modal Screens for User Interactions Chevron down icon Chevron up icon
Menus - Display Actions That Pop Out Chevron down icon Chevron up icon
Typography - Control Font Look and Feel Chevron down icon Chevron up icon
Icons - Enhance Icons to Match Your Look and Feel Chevron down icon Chevron up icon
Themes - Centralize the Look and Feel of Your App Chevron down icon Chevron up icon
Styles - Applying Styles to Components Chevron down icon Chevron up icon
Other Books You May Enjoy Chevron down icon Chevron up icon

Customer reviews

Top Reviews
Rating distribution
Full star icon Full star icon Full star icon Half star icon Empty star icon 3.5
(6 Ratings)
5 star 33.3%
4 star 16.7%
3 star 16.7%
2 star 33.3%
1 star 0%
Filter icon Filter
Top Reviews

Filter reviews by




changwo Jan 12, 2021
Full star icon Full star icon Full star icon Full star icon Full star icon 5
good
Amazon Verified review Amazon
Aletha Apr 25, 2019
Full star icon Full star icon Full star icon Full star icon Full star icon 5
Very good book for web design students.It takes you through reasoning and analysis of code with examples that you can test yourself.You won't be disappointed.
Amazon Verified review Amazon
Joseph King Aug 09, 2019
Full star icon Full star icon Full star icon Full star icon Empty star icon 4
Regarding Material-UI, I found quality material hard to come by. This book filled a hole and got me up to speed quite quickly.
Amazon Verified review Amazon
Biju Oct 25, 2020
Full star icon Full star icon Full star icon Empty star icon Empty star icon 3
Quite good examples and sample code. Could have had more conceptual explanation
Amazon Verified review Amazon
Boris Kontoroivch Dec 15, 2019
Full star icon Full star icon Empty star icon Empty star icon Empty star icon 2
Book is helpful, but its poorly formatted.
Amazon Verified review Amazon
Get free access to Packt library with over 7500+ books and video courses for 7 days!
Start Free Trial

FAQs

What is included in a Packt subscription? Chevron down icon Chevron up icon

A subscription provides you with full access to view all Packt and licnesed content online, this includes exclusive access to Early Access titles. Depending on the tier chosen you can also earn credits and discounts to use for owning content

How can I cancel my subscription? Chevron down icon Chevron up icon

To cancel your subscription with us simply go to the account page - found in the top right of the page or at https://subscription.packtpub.com/my-account/subscription - From here you will see the ‘cancel subscription’ button in the grey box with your subscription information in.

What are credits? Chevron down icon Chevron up icon

Credits can be earned from reading 40 section of any title within the payment cycle - a month starting from the day of subscription payment. You also earn a Credit every month if you subscribe to our annual or 18 month plans. Credits can be used to buy books DRM free, the same way that you would pay for a book. Your credits can be found in the subscription homepage - subscription.packtpub.com - clicking on ‘the my’ library dropdown and selecting ‘credits’.

What happens if an Early Access Course is cancelled? Chevron down icon Chevron up icon

Projects are rarely cancelled, but sometimes it's unavoidable. If an Early Access course is cancelled or excessively delayed, you can exchange your purchase for another course. For further details, please contact us here.

Where can I send feedback about an Early Access title? Chevron down icon Chevron up icon

If you have any feedback about the product you're reading, or Early Access in general, then please fill out a contact form here and we'll make sure the feedback gets to the right team. 

Can I download the code files for Early Access titles? Chevron down icon Chevron up icon

We try to ensure that all books in Early Access have code available to use, download, and fork on GitHub. This helps us be more agile in the development of the book, and helps keep the often changing code base of new versions and new technologies as up to date as possible. Unfortunately, however, there will be rare cases when it is not possible for us to have downloadable code samples available until publication.

When we publish the book, the code files will also be available to download from the Packt website.

How accurate is the publication date? Chevron down icon Chevron up icon

The publication date is as accurate as we can be at any point in the project. Unfortunately, delays can happen. Often those delays are out of our control, such as changes to the technology code base or delays in the tech release. We do our best to give you an accurate estimate of the publication date at any given time, and as more chapters are delivered, the more accurate the delivery date will become.

How will I know when new chapters are ready? Chevron down icon Chevron up icon

We'll let you know every time there has been an update to a course that you've bought in Early Access. You'll get an email to let you know there has been a new chapter, or a change to a previous chapter. The new chapters are automatically added to your account, so you can also check back there any time you're ready and download or read them online.

I am a Packt subscriber, do I get Early Access? Chevron down icon Chevron up icon

Yes, all Early Access content is fully available through your subscription. You will need to have a paid for or active trial subscription in order to access all titles.

How is Early Access delivered? Chevron down icon Chevron up icon

Early Access is currently only available as a PDF or through our online reader. As we make changes or add new chapters, the files in your Packt account will be updated so you can download them again or view them online immediately.

How do I buy Early Access content? Chevron down icon Chevron up icon

Early Access is a way of us getting our content to you quicker, but the method of buying the Early Access course is still the same. Just find the course you want to buy, go through the check-out steps, and you’ll get a confirmation email from us with information and a link to the relevant Early Access courses.

What is Early Access? Chevron down icon Chevron up icon

Keeping up to date with the latest technology is difficult; new versions, new frameworks, new techniques. This feature gives you a head-start to our content, as it's being created. With Early Access you'll receive each chapter as it's written, and get regular updates throughout the product's development, as well as the final course as soon as it's ready.We created Early Access as a means of giving you the information you need, as soon as it's available. As we go through the process of developing a course, 99% of it can be ready but we can't publish until that last 1% falls in to place. Early Access helps to unlock the potential of our content early, to help you start your learning when you need it most. You not only get access to every chapter as it's delivered, edited, and updated, but you'll also get the finalized, DRM-free product to download in any format you want when it's published. As a member of Packt, you'll also be eligible for our exclusive offers, including a free course every day, and discounts on new and popular titles.