Entries by admin

Design.dev: A New Place to Find Free High-Quality Design Resources

Original Source: http://feedproxy.google.com/~r/tympanus/~3/01eg6tBjCxo/

This is a sponsored article written by our friends at Design.dev, a new website for design resources.

Whether you are a graphic designer, web designer or developer, working in the UI or UX field, or pretty much anything related to digital and print production, you likely have utilized premade digital assets in your projects. There are a variety of websites that offer these resources, but today we’d like to introduce you to the “new kid on the block”: Design.dev.

Design.dev was launched only a few months ago with the goal of providing high-quality free and premium digital resources for creative people, to help speed up your workflow and save you time and money in the process. Unlike other similar websites, the resources here are currently exclusive to Design.dev, so you won’t find them anywhere else. While this could change in the future as the site grows, for now this makes the website a great place to find unique creations to use in your projects.

Let’s take a closer look at what Design.dev has to offer, how it works, and why we think this resource is worth visiting.

First Impression: Easy To Search, Filter, and Find

Upon first arriving on the home page, you will see a grid of 12 product offerings below a category filter. Click on any of the categories (or multiple categories) to filter down to what you are searching for. Current categories include Icons, Illustrations, Premium, Print, Social, UI Kits, and Website Templates. There is a secondary filter that narrows your results down even more to the type of file included in the download. These filters include Illustrator, Affinity Designer, Photoshop, Sketch, and Figma. So whatever design software you are most comfortable with, you can filter to make sure you’re getting the editable file type you are looking for. 

You can also search for specific keywords using the search feature near the top of the page. 

Products are clearly labeled with a green “Free” banner or a blue “Premium” banner, so you know right away what the availability of each product is based on your membership in one of the two tiers. Each product listing also includes icons denoting the design software file type(s) it is available in, along with the category to which it belongs.

All of this will save you time when you are looking for something specific.

Helpful Asset Details

Click on a product to learn more about it and you will find a brief description, followed by a carousel of sample images. Click on any of the images in the carousel to view it full size, which is helpful to see the detail within each offering.

There is also a sidebar on each single product page that tells you the category, file format(s), number of elements in the file and the file download size. Good to know what you’re getting into before you download the file.

Single, Simple License: Use In Personal and Commercial Projects Without Attribution

You don’t have to worry about any complex legal jargon or uncertainty of what you can or can’t do with the items you download. Every product on Design.dev falls under the same license and can be used in both personal and commercial projects without attribution. You can modify them however you want as well. The only limitation is you that cannot resell them.

Some Example Digital Resources We Liked

10 Abstract Background Illustrations (Free)

Who doesn’t use backgrounds in their projects? These ten unique background illustrations can be used in a variety of projects and they are truly one of a kind.

Restaurant Website Template (Premium)

This well-designed and complete website template kit includes 5 pages in both desktop and mobile versions, so you can use it for your next restaurant website and simply update the branding, colors and content to match you or your client’s needs.

36 Symbols of Summer (Free)

These playful illustrations can be used as icons or however else you’d like to add fun and individuality to your summer-themed project.

Furr – Mobile Ecommerce UI Kit (Free)

This clean, well-designed and thought out mobile ecommerce kit includes 12 app screens that take the user from signup through shopping to purchase. You could use this kit in a multitude of contexts by simply changing out the products and editing the branding for a quick mockup to present to your client.

Free Membership: Simple to Sign Up and Start Downloading Assets

Price is always a major consideration when choosing where to get your digital assets to use in your projects. That’s one of the primary reasons Design.dev stands out in its field. With a significant percentage of their offerings available for free, and new free products being added regularly, the website should become a regular part of your resource-searching routine. Best of all, the requirements for membership are simple: just your name, email address, username, and password is all that’s needed to start downloading every single free product on the website!

Premium Membership For Only $10 per Month

If you would like to up your game and increase the span of products you can download, you can sign up for a Premium membership for only $10 per month. That’s a great price, and it is for a limited time for “early adopters”. This means that at some point in time that price is going to increase, but you can lock in the $10 monthly subscription now and even when the price goes up for new members, yours will not change. It’s a great way to lock in the low price now so that in the future you will still have access to all of the Premium products they will be adding without having to pay anything additional.

Final Thoughts

It is obvious that this new website has the potential to become a go-to resource for designers and developers alike. While the current product offering is relatively smaller than other, more established websites, Design.dev looks to be committed to continually growing, improving, and adding many more products on a regular basis. That, paired with the unique and exclusive design resources currently listed, make this website one to bookmark and watch. We encourage you to give it a visit and see what you can find that will help you save time and money in your future projects, as well as possibly spark some inspiration and imagination for your own designs.

The post Design.dev: A New Place to Find Free High-Quality Design Resources appeared first on Codrops.

‘Gibberish’ Illustrations and Doodles

Original Source: http://feedproxy.google.com/~r/abduzeedo/~3/zNcq958WX94/gibberish-illustrations-and-doodles

‘Gibberish’ Illustrations and Doodles
‘Gibberish’ Illustrations and Doodles

AoiroStudio09.11.20

First of all, these are not ‘gibberish’ but that’s how ori toor humorously calls his playful, creative and beautiful illustration & doodle series. At first, I was even questioning why he calls it ‘Gibberish’ but just by reading his bio, you quickly understand why. Basically, Ori is a master of his craft at doodling sketches without any planning just improvising. This is something I dearly appreciate, it’s fun to just let go of things and let your mind go free to be creative. We are featuring his set titled: ‘Gibberish Dark Mode (And one light)’ but I would totally suggest you visit his Behance for more of his delightful style.

Links

http://www.oritoor.com
https://www.behance.net/oritoor

Image may contain: cartoon, art and illustration

Image may contain: cartoon, art and screenshot

Image may contain: cartoon, illustration and poster

Image may contain: cartoon, poster and art

Image may contain: cartoon, illustration and screenshot

 


30+ Useful Pure CSS Code Snippets

Original Source: http://feedproxy.google.com/~r/1stwebdesigner/~3/Ox4LMH-rGr4/

In this post, we’ve rounded up a collection of useful pure CSS code snippets for elements that are commonly used when designing and developing a website. We’ve included a few that may be less common, but might be useful for you if you are looking for a way to level up or add interest in your project.

From parallax to animations to tabs and accordions, this list should be helpful for you to refer to any time you are looking for accomplishing something in your web development utilizing only pure CSS and no JavaScript. So be sure to bookmark this page so you can refer to it next time you are looking for some guidance or inspiration.

Unlimited Web Template Downloads Starting at ONLY $16.50 per Month

Site Templates

Site Templates
2,000+ Site Templates

WordPress Themes

WordPress Themes
1,200+ WP Themes

Landing Pages

Landing Pages
600+ Landing Pages

DOWNLOAD NOW
Envato Elements

Slide Down Toggle

A clean and simple hidden panel that slides down smoothly when the button is clicked.

See the Pen Pure CSS Slide Down Toggle by Surjith (@surjithctly) on <a href=’https://codepen.io‘>CodePen.dark

Animated Gradient Background

Here’s a subtle animation effect where the background gradient slowly and endlessly changes.

See the Pen Pure CSS Gradient Background Animation by Manuel Pinto (@P1N2O) on <a href=’https://codepen.io‘>CodePen.dark

Parallax Star Background

A mesmerizing background with stars moving slowly through the night sky.

See the Pen Parallax Star background in CSS by Saransh Sinha (@saransh) on <a href=’https://codepen.io‘>CodePen.dark

Parallax Scrolling

Some may say that parallax has come and gone, but this cool pure CSS version makes a statement that you might want to utilize in your next project.

See the Pen Pure CSS Parallax Scrolling by Keith Clark (@keithclark) on <a href=’https://codepen.io‘>CodePen.dark

Form With SVG Radio Buttons

A simple form with radio buttons replaced with SVGs and a subtle animation.

See the Pen Form with SVG radio buttons by Angela Velasquez (@AngelaVelasquez) on <a href=’https://codepen.io‘>CodePen.dark

Hamburger Slide Out Menu

A handy, simple slide out menu that appears when the hamburger icon is clicked.

See the Pen Pure CSS Hamburger fold-out menu by Erik Terwan (@erikterwan) on <a href=’https://codepen.io‘>CodePen.dark

Custom Checkboxes

Nicely styled checkboxes that will give your forms a clean look.

See the Pen Pure CSS custom checkboxes by Glen Cheney (@Vestride) on <a href=’https://codepen.io‘>CodePen.dark

Popup Modal Window

How about a clean popup modal window that doesn’t use any JavaScript? Here’s one.

See the Pen Pure css popup box by Prakash (@imprakash) on <a href=’https://codepen.io‘>CodePen.dark

CSS Slider

A nice looking, smooth operating content slider with animations and navigation, all in pure CSS.

See the Pen Pure CSS Slider by Damian Drygiel (@drygiel) on <a href=’https://codepen.io‘>CodePen.dark

Glitched Text Animation

Here’s a cool glitch text animation effect that could work well for large headings.

See the Pen CSS Glitched Text by Lucas Bebber (@lbebber) on <a href=’https://codepen.io‘>CodePen.dark

Animated Gradient Ghost Button

Want to spruce up your buttons? Try this nice gradient animation.

See the Pen Animated Gradient Ghost Button Concept by Arsen Zbidniakov (@ARS) on <a href=’https://codepen.io‘>CodePen.dark

One Page Navigation Menu

This is a very clean, single page website with left navigation, where each page slides out from the right without refreshing the browser.

See the Pen One Page Navigation CSS Menu by Alberto Hartzet (@hrtzt) on <a href=’https://codepen.io‘>CodePen.dark

One Page Vertical Navigation

Similar to the previous snippet, and by the same author, this variation loads each page as a sliding panel from the bottom, along with keyboard navigation that syncs with the vertical menu.

See the Pen Pure CSS One page vertical navigation by Alberto Hartzet (@hrtzt) on <a href=’https://codepen.io‘>CodePen.dark

Image Slider

Another pure CSS image slider with a nifty animated transition between slides.

See the Pen CSS image slider w/ next/prev btns & nav dots by Avi Kohn (@AMKohn) on <a href=’https://codepen.io‘>CodePen.dark

Tabs

Need some easy to code/use CSS-only tabs in your next project? Here is a good example!

See the Pen Pure CSS Tabs by Wallace Erick (@wallaceerick) on CodePen.dark

Accordion

How about an accordion instead of tabs to display your content? Thought you couldn’t do it without JavaScript? Think again!

See the Pen Pure CSS Accordion by Rau (@raubaca) on <a href=’https://codepen.io‘>CodePen.dark

Direction-Aware Hover

Here’s a neat trick! Hover over the box from any side and it reveals something different based on which side you slid your cursor in from.

See the Pen Direction aware hover pure CSS by Fabrice W. (@FWeinb) on <a href=’https://codepen.io‘>CodePen.dark

Horizontal News Ticker

An old-school news ticker effect without any Javascript? Yes, it can be done!

See the Pen Pure CSS Ticker (Horizontal) by Lewis Carey (@lewismcarey) on <a href=’https://codepen.io‘>CodePen.dark

Multiline Text Cut Off With Ellipsis

This is a little specific, but still useful in the correct context. Perhaps you need equal height blog post excerpts. Do it with this pure CSS snippet.

See the Pen Pure CSS multiline text with ellipsis by Martin Wolf (@martinwolf) on <a href=’https://codepen.io‘>CodePen.dark

Toggle Buttons

Five clean looking animated toggle buttons.

See the Pen Pure CSS toggle buttons by Mauricio Allende (@mallendeo) on <a href=’https://codepen.io‘>CodePen.dark

Swanky Drop Down Menu

This is a really nice vertical drop down menu with great animations.

See the Pen Swanky Pure CSS Drop Down Menu V2.0 by Jamie Coulter (@jcoulterdesign) on <a href=’https://codepen.io‘>CodePen.dark

12 Loader Animations

Here are some useful spinners and loaders you can use for page load animations.

See the Pen Pure CSS Loaders kit by Viduthalai Mani (@viduthalai1947) on <a href=’https://codepen.io‘>CodePen.dark

Content Filter

A very handy, pure CSS content filter with a multitude of possible use cases.

See the Pen Pure CSS content filter by Sam Gordon (@samgordon) on <a href=’https://codepen.io‘>CodePen.dark

Swagtastic UI Stat Pop Out

A beautifully styled layout that could be used for statistics, a pricing table, or whatever your imagination comes up with.

See the Pen UI Statistic Pop Out CSS by Jamie Coulter (@jcoulterdesign) on <a href=’https://codepen.io‘>CodePen.dark

Folder Tree

A simple folder tree without any JavaScript.

See the Pen Pure CSS Tree by Rafael González (@rgg) on <a href=’https://codepen.io‘>CodePen.dark

Fancy Checkbox and Radio Buttons

Another variation on nicer than browser default checkbox and radio buttons.

See the Pen Pure CSS Fancy Checkbox/Radio by Rau (@raubaca) on <a href=’https://codepen.io‘>CodePen.dark

News Cards

This would be great for a blog post listing. Hover over a card to reveal the excerpt and read more link.

See the Pen News Cards – CSS only by Aleksandar Čugurović (@choogoor) on <a href=’https://codepen.io‘>CodePen.dark

Peeling Sticky

Here’s a fun animation of a label that peels off on hover. How could you use this one?

See the Pen Pure CSS Peeling Sticky by patrickkunka (@patrickkunka) on <a href=’https://codepen.io‘>CodePen.dark

Horizontal Hover Accordion

A nifty horizontal accordion that reveals content on hover.

See the Pen Pure CSS Horizontal Accordion by Aysha Anggraini (@rrenula) on <a href=’https://codepen.io‘>CodePen.dark

Funky Vertical Accordion

Another very nicely done vertical accordion with slick animations and zero JavaScript.

See the Pen Funky Pure CSS Accordion by Jamie Coulter (@jcoulterdesign) on CodePen.dark

Animated Toggles

Another set of toggles, this time in flat and 3D versions, with unique animations for each.

See the Pen Pure CSS Toggles by Rafael González (@rgg) on <a href=’https://codepen.io‘>CodePen.dark

Button Hover Animation

Spice up your buttons and links with this neat little hover animation effect.

See the Pen Button Hover by Katherine Kato (@kathykato) on <a href=’https://codepen.io‘>CodePen.dark

How will you use these handy pure CSS code snippets?

We hope you will find these pure CSS code snippets useful in your future projects, and hopefully we will save you some time next time you’re looking for any of these common elements to incorporate into your development.


Collective #622

Original Source: http://feedproxy.google.com/~r/tympanus/~3/0Bki41-yHfI/

Collective 622 item image

Inspirational Website of the Week: MGcream

A fun design with a modern touch and some lovely details. Our pick this week.

Get inspired

Collective 622 item image

This content is sponsored via Syndicate Ads
Website Heatmaps & Behaviour Analytics Tool

Understand how users are really experiencing your site without drowning in numbers!

Try it free

Collective 622 item image

Parsel

Parsel is a tiny, permissive CSS selector parser by Lea Verou.

Check it out

Collective 622 item image

react-three-flex

React-three-flex brings the flexbox spec to react-three-fiber to make it easier to place content. Check out this amazing demo. By Paul Henschel.

Check it out

Collective 622 item image

REST API: Sorting, Filtering, and Pagination

In this great tutorial, Tania Rascia makes an example API endpoint and SQL query for various sort, paginate, and filter APIs.

Read it

Collective 622 item image

Custom, accessible radio/checkbox buttons with perfect alignment

Learn how to create custom, accessible radio and checkbox buttons in CSS that perfectly align with their labels.

Check it out

Collective 622 item image

How to pick more beautiful colors for your data visualizations

Lisa Charlotte Rost explains how to choose the right colors for your charts and visualizations.

Check it out

Collective 622 item image

Alter

A creative 3D typeface exploration by Yuin Chien.

Check it out

Collective 622 item image

AVIF has landed

Jake Archibald introduces the new AVIF image format that is derived from the keyframes of AV1 video.

Read it

Collective 622 item image

Accessible Color Standards – Designing in the Browser

Una Kravets talks about color contrast in this new episode of “Designing in the Browser”.

Watch it

Collective 622 item image

vanilla-colorful

A tiny color picker custom element for modern web apps. By Serhii Kulykov.

Check it out

Collective 622 item image

Designing With Reduced Motion For Motion Sensitivities

An article by Val Head on how to use the prefers-reduced-motion-media feature.

Read it

Collective 622 item image

How to build awesome forms with only HTML & CSS

A great Twitter thread by Arslan Khalid on how to build solid forms in a step-by-step manner.

Check it out

Collective 622 item image

Candy Ring Preloader

A clever faux 3D ring preloader made by Jon Kantner.

Check it out

Collective 622 item image

What is the Value of Browser Diversity?

Dave Rupert tries to answer a very important question.

Read it

Collective 622 item image

DevTools architecture refresh: Migrating to JavaScript modules

The first article in a series of blog posts describing the changes the Chrome DevTools team is making to DevTools’ architecture and how it is built.

Read it

Collective 622 item image

Duo

A really cool Three.js and GSAP demo by ycw. Check out this one, too.

Check it out

Collective 622 item image

Read Me: Magazine

A fantastic Readymag essay (and template) on how to create good content and set it in type.

Check it out

Collective 622 item image

How they test

A curated collection of publicly available resources on how software companies around the world test their software systems and build their quality culture.

Check it out

Collective 622 item image

#s3e36 ALL YOUR HTML, Interactive Ribbon

A really good video tutorial by Yuri Artyukh where he dissects and builds an interactive WebGL ribbon.

Watch it

Collective 622 item image

Education & LMS landing page design

A free landing page designed in Sketch with an educational theme.

Check it out

Collective 622 item image

Responsive “Cool” Steps

Some fantastic step trickery by Jhey Tompkins.

Check it out

Collective 622 item image

BLINK 3D Gallery

In case you haven’t seen this yet: BLINK is an online platform where art collectors, artists, and art lovers can meet and mingle to explore and enjoy art together.

Check it out

Collective 622 item image

Styling Complex Labels

Danielle Romo’s tip on how to deal with more verbose input labels.

Read it

The post Collective #622 appeared first on Codrops.

Branding & Full Visual Identity for La Mala Pub

Original Source: http://feedproxy.google.com/~r/abduzeedo/~3/DTmyxjanGuk/branding-full-visual-identity-la-mala-pub

Branding & Full Visual Identity for La Mala Pub
Branding & Full Visual Identity for La Mala Pub

abduzeedo09.09.20

Estudio Nuar shared a beautiful branding project for La Mala Pub. Right in the heart of Palermo, La Mala Pub leads Buenos Aires nightlife. Only a few months after opening, it became so trending that generated the need for more space. In consequence, an extra space was attached and Malita was created. It was a joint work with the architecture team to design the new identity for this space and then generate all the graphic interventions and signage applications. 

La Mala in Spanish means “Bad Girl” and that’s what triggered the visual imaginary, with all these really empowered girls, a bit vintage but updated with the vibrant colors, the contemporary phrases and the spacial mood, meaning she’s from outer space. 

We created this multifaceted character who represents La Mala but also every girl who goes there. Apart from the posters, which are one of the main characters, we worked a lot on the neon signs, together with the architecture team, as they were very important taking into consideration it’s a night pub and the lighting is fundamental.

Credits

Creative Direction: Manuela Ventura y Melisa Rivas.
Architecture: Hitzig Militello Arquitectos.
Production: Crista Bernasconi.
Equipment: Krapa.
Design: Manuela Ventura, Melisa Rivas, Crista Bernasconi y Natasha Furst.
Photography: Federico Kulekdjian.
Animation: Malena Sueiro.


Collective #620

Original Source: http://feedproxy.google.com/~r/tympanus/~3/aujgmiRDX8U/

Inspirational Website of the Week: keysshoes

We love the fun layouts and diverse details! Our pick this week.

Get inspired

What is the Small Web?

Aral Balkan has a vision for the future where every person owns and controls their own place on the shared global network. He also introduces Site.js, a Small Web construction set.

Read it

ztext.js

Easy to implement, 3D typography for the web that works with every font.

Check it out

Collective 619 Item Image

Our Sponsor
The Divi Summer Sale

Only 4 days left! Don’t miss your chance to get a 20% discount on the most powerful WordPress theme in the world.

Check it out

Umami

Umami is a simple, easy to use, self-hosted web analytics solution.

Check it out

The Thing With Leading in CSS

A must-read article by Matthias Ott on why design and implementation can look so different for vertical spaces between texts.

Read it

How to Use AVIF: The New Next-Gen Image Compression Format

Start using next-gen .avif images today progressively with the <picture> element. The format is ~50% smaller in size compared to JPEG, and ~20% smaller than WebP.

Building the Zig-Zag Gradient Lab

Michelle Barker shares the video and transcript of her talk at Vienna Calling about the Zig-Zag Gradient Lab.

Check it out

Use advanced typography with local fonts

Learn all about the Local Fonts API which enumerates the user’s installed local fonts and provides low-level access to the various TrueType/OpenType tables.

Read it

The difference between aria-label and aria-labelledby

Léonie Watson explains the difference between two important accessibility attributes.

Read it

Flume

In case you missed it: Flume is a React-powered node editor and runtime engine

Check it out

Best way to lazy load images for maximum performance

Adrian Bece shows the modern approach of lazy loading images.

Read it

Create blurred fills for images with aspect ratio containers in CSS

A very useful demo by Martijn Cuppens that shows how to automatically create blurred fills as background for images.

Check it out

Codemap

Codemap visualizes function calls in a intuitive way where you can navigate your code in a graph.

Check it out

Gradient Magic

A gallery of stylish and unique CSS gradients.

Check it out

#s3e35 ALL YOUR HTML, Moving through infinite clouds

A great tutorial where Yuri Artyukh shows how to implement the infinite clouds effect from the makingmaiselmarvelous.com site.

Watch it

A Tapestry of Tools

Daniel Eden on the effectiveness of using a variety of design tools.

Read it

Teal

With Teal you can build stateful and portable serverless applications quickly.

Check it out

handwritten.js

With this library you can convert typed text to an image of realistic handwriting.

Check it out

Why CSS Logical Properties Aren’t Ready for Use!

Elad Shechter explains why the new CSS logical properties module is not yet ready for prime time.

Read it

MergeURL

MergeURL helps you merge multiple URLs hassle-free without any user registration.

Check it out

Accordion Icons: Which Signifiers Work Best?

Page Laubheimer and Raluca Budiu looked at several possible icons as signifiers for accordions and found out which one works best.

Read it

Ct.js

In case you didn’t know about it: Ct.js is a free 2D game editor based on web technologies.

Check it out

CSS Shapes Layout Experiment

A funky shapes layout experiment by Kristopher Van Sant.

Check it out

Github Profile Readme Generator

Prettify your GitHub user profile with this readme generator.

Check it out

From Our Blog
Experimental Triangle Image Transitions with WebGL

Some experimental animations using triangles for image transitions with WebGL.

Check it out

From Our Blog
Awesome Demos Roundup #17

A fresh roundup of the most interesting and creative web experiments from the last couple of weeks.

Check it out

The post Collective #620 appeared first on Codrops.

How To Build A Blog With Next And MDX

Original Source: https://smashingmagazine.com/2020/09/build-blog-nextjs-mdx/

Next.js is a React framework that enables you to build static and dynamic apps quickly. It is production-ready and supports server-side rendering and static site generation out of the box, making Next.js apps fast and SEO-friendly.

In this tutorial, I will first explain what exactly Next.js is and why you’d use it instead of Create React App or Gatsby. Then, I’ll show you how to build a blog on which you can write and render posts using Next.js and MDX.

To get started, you’ll need some experience with React. Knowledge of Next.js would come handy but is not compulsory. This tutorial would benefit those who want to create a blog (personal or organizational) using Next.js or are still searching for what to use.

Let’s dive in.

What Is Next.js?

Next.js is a React framework created and maintained by Vercel. It’s built with React, Node.js, Babel, and Webpack. It is production-ready because it comes with a lot of great features that would usually be set up in a “vanilla” React app.

The Next.js framework can render apps on the server or export them statically. It doesn’t wait for the browser to load the JavaScript in order to show content, which makes Next.js apps SEO-friendly and blazing fast.

Why Use Next.js Over Create React App?

Create React App is a handy tool that offers a modern build setup with no configuration and without the hassle of having to set up Webpack, Babel, and so on or having to maintain their dependencies. It’s the recommended way to create React apps nowadays. It has a template for TypeScript and also comes with the React Testing Library.

However, if you want to build a multi-page app, then you’ll need to install an extra library, as if you were rendering a React app on the server. The extra setup could be a problem, and any packages installed could increase the final bundle size of your app.

This is exactly the problem that Next.js is intended to solve. It offers the best developer experience, with all of the things you need for production. It comes with several cool features:

Static exporting (pre-rendering)
Next.js allows you to export your Next.js app at build time to static HTML that runs without a server. It is the recommended way to generate your website because it’s done at build time and not at each request.
Server-side rendering (pre-rendering)
It pre-renders pages to HTML on the server upon every request.
Automatic code splitting
Unlike React, Next.js splits code automatically and only loads the JavaScript needed, which makes the app fast.
File-system-based routing
Next.js uses the file system to enable routing in the app, meaning that every file under the pages directory will be treated automatically as a route.
Hot reloading of code
Next.js relies on React Fast Refresh to hot reload your code, offering a great developer experience.
Styling options
The Next.js framework has built-in support for Styled JSX, CSS modules, Sass, LESS, and more.

Next.js Versus Gatsby

Gatsby is a static site generator built on top of React and GraphQL. It is popular and has a huge ecosystem that provides themes, plugins, recipes, and so on.

Gatsby and Next.js websites are super-fast because they are both rendered either on the server or statically, meaning that the JavaScript code does not wait for the browser to load. Let’s compare them according to the developer experience.

Gatsby is easy to start with, especially if you already know React. However, Gatsby uses GraphQL to query local data and pages. Using Gatsby to build this simple blog might be overkill because GraphQL has a learning curve, and the querying and build time of static pages would be a bit longer. If you built this same blog twice, first with Gatsby and then with Next.js, the one built with Next.js would be much faster at build time because it uses regular JavaScript to query local data and pages.

I hope you take advantage of the power of the Next.js framework and see why it’s so much handier than some alternatives. It’s also a great choice if your website relies heavily on SEO because your app will be fast and easy for Google robots to crawl. That’s the reason why we will be using Next.js in this article to build a blog with the MDX library.

Let’s start by setting up a new Next.js app.

Setting Up

There are two ways to create a Next.js app. We can set up a new app manually or use Create Next App. We’ll go for the latter because it’s the recommended way, and it will set up everything automatically for us.

To start a new app, run the following in the command-line interface (CLI):

npx create-next-app

Once the project is initialized, let’s structure the Next.js app as follows:

src
├── components
| ├── BlogPost.js
| ├── Header.js
| ├── HeadPost.js
| ├── Layout.js
| └── Post.js
├── pages
| ├── blog
| | ├── post-1
| | | └── index.mdx
| | ├── post-2
| | | └── index.mdx
| | └── post-3
| | └── index.mdx
| ├── index.js
| └── _app.js
├── getAllPosts.js
├── next.config.js
├── package.json
├── README.md
└── yarn.lock

As you can see, our project has a simple file structure. There are three things to note:

_app.js allows us to append some content to the App.js component in order to make it global.
getAllPosts.js helps us to retrieve the blog posts from the folder pages/blog. By the way, you can name the file whatever you want.
next.config.js is the configuration file for our Next.js app.

I will come back to each file later and explain what it does. For now, let’s see the MDX package.

Installing the MDX Library

MDX is a format that lets us seamlessly write JSX and import components into our Markdown files. It enables us to write regular Markdown and embed React components in our files as well.

To enable MDX in the app, we need to install the @mdx-js/loader library. To do so, let’s first navigate to the root of the project and then run this command in the CLI:

yarn add @mdx-js/loader

Or, if you’re using npm:

npm install @mdx-js/loader

Next, install @next/mdx, which is a library specific to Next.js. Run this command in the CLI:

yarn add @next/mdx

Or, for npm:

npm install @next/mdx

Great! We are done setting up. Let’s get our hands dirty and code something meaningful.

Configuring the next.config.js File
const withMDX = require(“@next/mdx”)({
extension: /.mdx?$/
});

module.exports = withMDX({
pageExtensions: [“js”, “jsx”, “md”, “mdx”]
});

Earlier in this tutorial, I said that files under the pages folder would be treated as pages/routes by Next.js at build time. By default, Next.js will just pick files with .js or .jsx extensions. That’s why we need a config file, to add some customizations to the default behavior of Next.js.

The next.config.js file tells the framework that files with .md or .mdx extensions should also be treated as pages/routes at build time because the blog folder that contains the articles lives in the pages directory.

That being said, we can start fetching the blog posts in the next part.

Fetching Blog Posts

One of the reasons why building a blog with Next.js is easy and simple is that you do not need GraphQL or the like to fetch local posts. You can just use regular JavaScript to get the data.

In getAllPosts.js:

function importAll(r) {
return r.keys().map((fileName) => ({
link: fileName.substr(1).replace(//index.mdx$/, “”),
module: r(fileName)
}));
}

export const posts = importAll(
require.context(“./pages/blog/”, true, /.mdx$/)
);

This file can be intimidating at first. It’s a function that imports all MDX files from the folder pages/blog, and for each post it returns an object with the path of the file, without the extension (/post-1), and the data of the blog post.

With that in place, we can now build the components in order to style and show data in our Next.js app.

Building The Components

In components/Layout.js:

import Head from “next/head”;
import Header from “./Header”;

export default function Layout({ children, pageTitle, description }) {
return (
<>
<Head>
<meta name=”viewport” content=”width=device-width, initial-scale=1″ />
<meta charSet=”utf-8″ />
<meta name=”Description” content={description}></meta>
<title>{pageTitle}</title>
</Head>
<main>
<Header />
<div className=”content”>{children}</div>
</main>
</>
);
}

Here, we have the Layout component, which we’ll be using as a wrapper for the blog. It receives the meta data to show in the head of the page and the component to be displayed.

In components/Post.js:

import Link from ‘next/link’
import { HeadPost } from ‘./HeadPost’

export const Post = ({ post }) => {
const {
link,
module: { meta },
} = post

return (
<article>
<HeadPost meta={meta} />
<Link href={‘/blog’ + link}>
<a>Read more →</a>
</Link>
</article>
)
}

This component is responsible for displaying a preview of a blog post. It receives the post object to show as props. Next, we use destructuring to pull out the link of the post and the meta to show from the object. With that, we can now pass the data to the components and handle the routing with the Link component.

In components/BlogPost.js:

import { HeadPost } from ‘./HeadPost’

export default function BlogPost({ children, meta}) {
return (
<>
<HeadPost meta={meta} isBlogPost />
<article>{children}</article>
</>
)
}

The BlogPost component helps us to render a single article. It receives the post to show and its meta object.

So far, we have covered a lot — but we have no articles to show. Let’s fix that in the next section.

Writing Posts With MDX

import BlogPost from ‘../../../components/BlogPost’

export const meta = {
title: ‘Introduction to Next.js’,
description: ‘Getting started with the Next framework’,
date: ‘Aug 04, 2020’,
readTime: 2
}

export default ({ children }) => <BlogPost meta={meta}>{children}</BlogPost>;

## My Headline

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Quisque maximus pellentesque dolor non egestas. In sed tristique elit. Cras vehicula, nisl vel ultricies gravida, augue nibh laoreet arcu, et tincidunt augue dui non elit. Vestibulum semper posuere magna, quis molestie mauris faucibus ut.

As you can see, we import the BlogPost component, which receives the meta and the body of the post.

The parameter children is the body of the blog post or, to be precise, everything that comes after the meta object. It is the function responsible for rendering the post.

With that change, we can move to the index.js file and display the posts on the home page.

Displaying Posts
import { Post } from “../components/Post”;
import { posts } from “../getAllPosts”;

export default function IndexPage() {
return (
<>
{posts.map((post) => (
<Post key={post.link} post={post} />
))}
</>
);
}

Here, we start by importing the Post component and the posts fetched from the blog folder. Next, we loop through the array of articles, and for each post, we use the Post component to display it. That being done, we are now able to fetch the posts and display them on the page.

We are almost done. However, the Layout component is still not being used. We can use it here and wrap our components with it. But that won’t affect the articles pages. That’s where the _app.js file comes into play. Let’s use that in the next section.

Using the _app.js File

Here, the underscore symbol (_) is really important. If you omit it, Next.js will treat the file as a page/route.

import Layout from “../components/Layout”;

export default function App({ Component, pageProps }) {
return (
<Layout pageTitle=”Blog” description=”My Personal Blog”>
<Component {…pageProps} />
</Layout>
);
}

Next.js uses the App component to initialize pages. The purpose of this file is to override it and add some global styles to the project. If you have styles or data that need to be shared across the project, put them here.

We can now browse the project folder in the CLI and run the following command to preview the blog in the browser:

yarn dev

Or, in npm:

npm run dev

If you open http://localhost:3000 in the browser, you will be able to see this:

Great! Our blog looks good. We are done building the blog app with Next.js and MDX.

Conclusion

In this tutorial, we walked through Next.js by building a blog using the MDX library. The Next.js framework is a handy tool that makes React apps SEO-friendly and fast. It can be used to build static, dynamic JAMstack websites in no time, because it is production-ready and comes with some nice features. Next.js is used widely by big companies, and its performance keeps improving. It’s definitely something to check out for your next project.

You can preview the finished project on CodeSandbox.

Thanks for reading!

Resources

These useful resources will take you beyond the scope of this tutorial.

Next.js documentation
Next.js and MDX documentation
“Create a Next.js App”, Next.js