Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Save more on your purchases! discount-offer-chevron-icon
Savings automatically calculated. No voucher code required.
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletter Hub
Free Learning
Arrow right icon
timer SALE ENDS IN
0 Days
:
00 Hours
:
00 Minutes
:
00 Seconds
Blazor WebAssembly by Example
Blazor WebAssembly by Example

Blazor WebAssembly by Example: A project-based guide to building web apps with .NET, Blazor WebAssembly, and C#

Arrow left icon
Profile Icon Toi B. Wright
Arrow right icon
$19.99 per month
Full star icon Full star icon Full star icon Full star icon Half star icon 4.5 (12 Ratings)
Paperback Jul 2021 266 pages 1st Edition
eBook
$26.98 $29.99
Paperback
$43.99
Subscription
Free Trial
Renews at $19.99p/m
Arrow left icon
Profile Icon Toi B. Wright
Arrow right icon
$19.99 per month
Full star icon Full star icon Full star icon Full star icon Half star icon 4.5 (12 Ratings)
Paperback Jul 2021 266 pages 1st Edition
eBook
$26.98 $29.99
Paperback
$43.99
Subscription
Free Trial
Renews at $19.99p/m
eBook
$26.98 $29.99
Paperback
$43.99
Subscription
Free Trial
Renews at $19.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

Blazor WebAssembly by Example

Chapter 2: Building Your First Blazor WebAssembly Application

Razor components are the building blocks of Blazor WebAssembly applications. A Razor component is a chunk of user interface that can be shared, nested, and reused. Razor components are ordinary C# classes and can be placed anywhere in a project.

In this chapter, we will learn about Razor components. We will learn how to use them, how to apply parameters, and about their life cycle and their structure. We will learn how to use the @page directive to define routing. We will also learn how to use Razor syntax to combine C# code with HTML markup.

The Blazor WebAssembly project in this chapter will be created by using the Blazor WebAssembly App project template provided by Microsoft. After we create the project, we will examine it to further familiarize ourselves with Razor components. We will learn how to use components, how to add parameters, how to apply routing, how to use Razor syntax, and how to separate the Razor markup and code into separate files. Finally, we will configure our own custom project template that creates an empty Blazor WebAssembly project.

In this chapter, we will cover the following topics:

  • Razor components
  • Routing
  • Razor syntax
  • Using the Blazor App project template
  • Creating an empty Blazor WebAssembly project template

Technical requirements

To complete this project, you need to have Visual Studio 2019 installed on your PC. For instructions on how to install the free Community edition of Visual Studio 2019, refer to Chapter 1, Introduction to Blazor WebAssembly.

The source code for this chapter is available in the following GitHub repository: https://github.com/PacktPublishing/Blazor-WebAssembly-by-Example/tree/main/Chapter02.

The code in action video is available here: https://bit.ly/3bEZrrg.

Razor components

Blazor WebAssembly is a component-driven framework. Razor components are the fundamental building blocks of a Blazor WebAssembly application. They are classes that are implemented using a combination of C#, HTML, and Razor markup. When the web app loads, the classes get downloaded into the browser as normal .NET assemblies (DLLs).

Important note

In this book, the terms Razor component and component are used interchangeably.

Using components

HTML element syntax is used to add a component to another component. The markup looks like an HTML tag where the name of the tag is the component type.

The following markup in the Pages\Index.razor file of the Demo project that we will create in this chapter will render a SurveyPrompt instance:

<SurveyPrompt Title="How is Blazor working for you?" />

The preceding SurveyPrompt element includes an attribute parameter named Title.

Parameters

Component parameters are used to make components dynamic. Parameters are public properties of the component that are decorated with either the Parameter attribute or the CascadingParameter attribute. Parameters can be simple types, complex types, functions, RenderFragments, or event callbacks.

The following code for a component named HelloWorld includes a parameter named Text:

HelloWorld.razor

<h1>Hello @Text!</h1>
@code {
    [Parameter] public string Text { get; set; }
}

To use the HelloWorld component, include the following HTML syntax in another component:

<HelloWorld Text="World" />

In the preceding example, the Text attribute of the HelloWorld component is the source of the Text parameter. This screenshot shows the results of using the component as indicated:

Figure 2.1 – HelloWorld component

Figure 2.1 – HelloWorld component

A component can also receive parameters from its route or a query string. You will learn more about the different types of parameters later in this chapter.

Naming components

The name of a Razor component must be in title case. Therefore, helloWorld would not be a valid name for a Razor component since the h is not capitalized. Also, Razor components use the RAZOR extension rather than the CSHTML extension that is used by Razor Pages.

Important note

Razor components must start with a capital letter.

Component life cycle

Razor components inherit from the ComponentBase class. The ComponentBase class includes both asynchronous and synchronous methods used to manage the life cycle of a component. In this book, we will be using the asynchronous versions of the methods since they execute without blocking other operations. This is the order in which the methods in the life cycle of a component are invoked:

  1. SetParameterAsync: This method sets the parameters that are supplied by the component's parent in the render tree.
  2. OnInitializedAsync: This method is invoked after the component is first rendered.
  3. OnParametersSetAsync: This method is invoked after the component initializes and each time the component re-renders.
  4. OnAfterRenderAsync: This method is invoked after the component has finished rendering. This method is for working with JavaScript since JavaScript requires the Document Object Model (DOM) elements to be rendered before they can do any work.

Component structure

The following diagram shows code from the Counter component of the Demo project that we will create in this chapter:

Figure 2.2 – Component structure

Figure 2.2 – Component structure

The code in the preceding example is divided into three sections:

  • Directives
  • Markup
  • Code Block

Each of the sections has a different purpose.

Directives

Directives are used to add special functionality, such as routing, layout, and dependency injection. They are defined within Razor and you cannot define your own directives.

In the preceding example, there is only one directive used – the @page directive. The @page directive is used for routing. In this example, the following URL will route the user to the Counter component:

/counter

A typical page can include many directives at the top of the page. Also, many pages have more than one @page directive.

Most of the directives in Razor can be used in a Blazor WebAssembly application. These are the Razor directives that are used in Blazor, in alphabetical order:

  • @attribute: This directive adds a class-level attribute to the component. The following example adds the [Authorize] attribute:

    @attribute [Authorize]

  • @code: This directive adds class members to the component. In the example, it is used to distinguish the code block.
  • @implements: This directive implements the specified class.
  • @inherits: This directive provides full control of the class that the view inherits.
  • @inject: This directive is used for dependency injection. It enables the component to inject a service from the dependency injection container into the view. The following example injects HttpClient defined in the Program.cs file into the component:

    @inject HttpClient Http

  • @layout: This directive is used to specify a layout for the Razor component.
  • @namespace: This directive sets the component's namespace. You only need to use this directive if you do not want to use the default namespace for the component. The default namespace is based on the location of the component.
  • @page: This directive is used for routing.
  • @typeparam: This directive sets a type parameter for the component.
  • @using: This directive controls the components that are in scope.

Markup

This is HTML with Razor syntax. The Razor syntax can be used to render text and allows C# to be used as part of the markup. We will cover more about Razor syntax later in this chapter.

Code block

The code block contains the logic for the page. It begins with the @code directive. By convention, the @code directive is at the bottom of the page. It is the only file-level directive that is not placed at the top of the page.

The code block is where we add C# fields, properties, and methods to the component. Later in this chapter, we will move the code block to a separate code-behind file.

Razor components are the building blocks of a Blazor WebAssembly application. They are easy to use since they are simply a combination of HTML markup and C# code. In the next section, we will see how routing is used to navigate between each of the components.

Routing in Blazor WebAssembly

In Blazor WebAssembly, routing is handled on the client, not on the server. As you navigate in the browser, Blazor intercepts that navigation and renders the component with the matching route.

The URLs are resolved relative to the base path that is specified in the wwwroot/index.html file. It is specified in the head element using the following syntax:

 <base href="/" />

Unlike other frameworks that you may have used, the route is not inferred from the location of its file. For example, in the Demo project, the Counter component is in the /Pages/Counter folder, yet it uses the following route:

@page "/counter"

Route parameters

The Router component uses route parameters to populate the parameters of the corresponding component. The parameters of both the component and the route must have the same name, but they are not case sensitive.

Since optional route parameters are not supported, you may need to provide more than one @page directive to a component to simulate optional parameters. The following example shows how to include multiple @page parameters:

RoutingExample.razor

@page "/routing"
@page "/routing/{text}"
<h1>Blazor WebAssembly is @Text!</h1>
@code {
    [Parameter] public string Text { get; set; }
    protected override void OnInitialized()
    {
        Text = Text ?? "fantastic";
    }
}

In the preceding code, the first @page directive allows navigation to the component without a parameter and the second @page directive allows a route parameter. If a value for text is provided, it is assigned to the Text property of the component. If the Text property of the component is null, it is set to fantastic.

The following URL will route the user to the RoutingExample component:

/routing

The following URL will also route the user to the RoutingExample component, but this time the Text parameter will be set by the route:

/routing/amazing

This screenshot shows the results of using the indicated route:

Figure 2.3 – RoutingExample component

Figure 2.3 – RoutingExample component

Important note

Route parameters are not case sensitive.

Catch-all route parameters

Catch-all route parameters are used to capture paths across multiple folder boundaries. This type of route parameter is a string type and can only be placed at the end of the URL.

This is a sample component that uses a catch-all route parameter:

CatchAll.razor

@page "/{*path}"
<h1>Catch All</h1>
Route: @Path
@code {
    [Parameter] public string Path { get; set; }
}

For the /error/type/3 URL, the preceding code will set the value of the Path parameter to error/type/3:

Figure 2.4 – Catch-all route parameter example

Figure 2.4 – Catch-all route parameter example

Route constraints

Route constraints are used to enforce the datatype of a route parameter. To define a constraint, add a colon followed by the constraint type to the parameter. In the following example, the route is expecting a route parameter named Increment with the type of int:

@page "/counter/{increment:int}"

The following route constraints are supported:

Figure 2.5 – Supported route constraints

Figure 2.5 – Supported route constraints

The following types are not currently supported as constraints:

  • Regular expressions
  • Enums
  • Custom constraints

Routing is handled on the client. We can use both route parameters and catch-all route parameters to enable routing. Route constraints are used to ensure that a route parameter is of the required datatype. Razor components use Razor syntax to seamlessly merge HTML with C# code, which is what we will see in the next section.

Left arrow icon Right arrow icon
Download code icon Download Code

Key benefits

  • Explore complete, easy-to-follow web projects using Blazor
  • Build projects such as a weather app, expense tracker, and Kanban board with real-world applications
  • Understand and work with Blazor WebAssembly effectively without spending too much time focusing on the theory

Description

Blazor WebAssembly makes it possible to run C# code on the browser instead of having to use JavaScript, and does not rely on plugins or add-ons. The only technical requirement for using Blazor WebAssembly is a browser that supports WebAssembly, which, as of today, all modern browsers do. Blazor WebAssembly by Example is a project-based guide for learning how to build single-page web applications using the Blazor WebAssembly framework. This book emphasizes the practical over the theoretical by providing detailed step-by-step instructions for each project. You'll start by building simple standalone web applications and progress to developing more advanced hosted web applications with SQL Server backends. Each project covers a different aspect of the Blazor WebAssembly ecosystem, such as Razor components, JavaScript interop, event handling, application state, and dependency injection. The book is designed in such a way that you can complete the projects in any order. By the end of this book, you will have experience building a wide variety of single-page web applications with .NET, Blazor WebAssembly, and C#.

Who is this book for?

This book is for .NET web developers who are tired of constantly learning new JavaScript frameworks and wish to write web applications using Blazor WebAssembly, leveraging the power of .NET and C#. The book assumes beginner-level knowledge of the C# language, .NET framework, Microsoft Visual Studio, and web development concepts.

What you will learn

  • Discover the power of the C# language for both server-side and client-side web development
  • Use the Blazor WebAssembly App project template to build your first Blazor WebAssembly application
  • Use templated components and the Razor class library to build and share a modal dialog box
  • Understand how to use JavaScript with Blazor WebAssembly
  • Build a progressive web app (PWA) to enable native app-like performance and speed
  • Understand dependency injection (DI) in .NET to build a shopping cart app
  • Get to grips with .NET Web APIs by building a task manager app

Product Details

Country selected
Publication date, Length, Edition, Language, ISBN-13
Publication date : Jul 09, 2021
Length: 266 pages
Edition : 1st
Language : English
ISBN-13 : 9781800567511
Vendor :
Microsoft
Languages :
Tools :

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 : Jul 09, 2021
Length: 266 pages
Edition : 1st
Language : English
ISBN-13 : 9781800567511
Vendor :
Microsoft
Languages :
Tools :

Packt Subscriptions

See our plans and pricing
Modal Close icon
$19.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
$199.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
$279.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 $ 173.97
Web Development with Blazor
$49.99
Blazor WebAssembly by Example
$43.99
C# 10 and .NET 6 – Modern Cross-Platform Development
$79.99
Total $ 173.97 Stars icon

Table of Contents

10 Chapters
Chapter 1: Introduction to Blazor WebAssembly Chevron down icon Chevron up icon
Chapter 2: Building Your First Blazor WebAssembly Application Chevron down icon Chevron up icon
Chapter 3: Building a Modal Dialog Using Templated Components Chevron down icon Chevron up icon
Chapter 4: Building a Local Storage Service Using JavaScript Interoperability (JS Interop) Chevron down icon Chevron up icon
Chapter 5: Building a Weather App as a Progressive Web App (PWA) Chevron down icon Chevron up icon
Chapter 6: Building a Shopping Cart Using Application State Chevron down icon Chevron up icon
Chapter 7: Building a Kanban Board Using Events Chevron down icon Chevron up icon
Chapter 8: Building a Task Manager Using ASP.NET Web API Chevron down icon Chevron up icon
Chapter 9: Building an Expense Tracker Using the EditForm Component 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 Full star icon Half star icon 4.5
(12 Ratings)
5 star 66.7%
4 star 16.7%
3 star 16.7%
2 star 0%
1 star 0%
Filter icon Filter
Top Reviews

Filter reviews by




Amazon Customer Jul 14, 2021
Full star icon Full star icon Full star icon Full star icon Full star icon 5
Packt never fails to impress with their content. Blazor WASM is an awesome new tool and this teaches you everything you need to know to make a well designed application. Like all Packt books, it is easy to pick up in different chapters depending on what you want to learn. I was specifically looking more into how to make a PWA with Blazor and this was a fantastic guide!
Amazon Verified review Amazon
Paul Schroeder Jul 26, 2021
Full star icon Full star icon Full star icon Full star icon Full star icon 5
I appreciate the author’s “no fluff” approach to covering all the basics Blazor developers need to know. As someone who has developed a few Blazor applications already, this meant that I was able to finish the content in just a few sessions. Being somewhat experienced, I certainly did pick up some new information, but I think beginner-to-intermediate developers will get the most out of this book.Personally, I thought the use of project templates was very appropriate and I wish more Visual Studio developers made use of this gem of an IDE feature. The sections on RenderFragment, EventCallback, CSS isolation, attribute splatting, and JS Interop were explained nicely. Content on Progressive Web Apps contained details, like the service worker life cycle, that were good to learn more about.I was impressed at the author’s ability to present straightforward examples, each of which demonstrated a Blazor capability with minimal code. Sticking close to just what is needed made it easy to understand what was happening.Overall, I liked this book, which is clearly designed to be a quick overview of each topic. After covering the basics, the author provides “further reading” sections at the conclusion of each chapter to make it easy to go deeper, if desired. There are also sample questions along the way that help you gauge your knowledge or think about what could be next if you want to experiment with extending the project samples.
Amazon Verified review Amazon
Adam Smith Apr 10, 2022
Full star icon Full star icon Full star icon Full star icon Full star icon 5
This book has a very pleasant way of teaching. A kind of step-by-step way. I give it a full 5 stars.
Amazon Verified review Amazon
Daniel Correa Aug 08, 2021
Full star icon Full star icon Full star icon Full star icon Full star icon 5
Blazor WebAssembly is the Microsoft's single-page application (SPA) framework for building web applications on .NET Framework. It is another option that front-end developers should have in mind. One of the main difference with their main competitors (Vue, React, Angular) is that it enables developers to run C# code on the client. It means, you can develop an entire SPA application without using JavaScript.Toi (the author of this book) teaches us how to use Blazor WebAssembly in a practical way. She provides a set of projects and examples which are very useful and which teaches us the fundamental elements of Blazor WebAssembly. For example, (i) you will implement a simple modal dialog application, which focuses on razor elements, components, and RenderFragments. (ii) You will implement a simple data storage application, which explains how to use JS Interop to execute some JavaScript commands from a Blazor WebAssembly application (there are some cases in which using JavaScript makes sense). (iii) You will implement a Weather App which uses service workers, APIs, and implementation of PWA applications. And (iv) even, it takes you to develop a complete front-end and back-end application (task manager) with the use of an ASP.NET Web API. Other topics and projects include: application state, events, edit forms, and dependency injection.All those projects (and many others) present proper explanations, with excellent examples. The code of the projects is easy to follow, simple, and properly detailed. Therefore, you can use some of those projects as a base to develop your own applications.This is a totally recommended book if you want to learn Blazor WebAssembly in a practical way, with very useful examples, and short explanations. Congratulations to the author.
Amazon Verified review Amazon
Justin Horner Jul 15, 2021
Full star icon Full star icon Full star icon Full star icon Full star icon 5
I love reading through example-focused books, and Blazor by Example is no exception! As the title states, this is a project-based guide to building web apps with .NET, Blazor WebAssembly, and C#.On your journey through learning Blazor by Example, you'll create several applications that scale up in complexity by chapter. Everything from creating your first Blazor application and making a weather app PWA to handling application state in a shopping cart experience gets covered throughout the projects in the book.I highly recommend this book to anyone interested in Blazor. It's a great learning resource and reference for Blazor WebAssembly projects.Here are a few of my chapter/topic highlights:- JS Interop- Building a Progressive Web App (PWA)- Using Application State- Building a Kanban Board using Events- Building a Task Manager using ASP.NET Web API
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.