{"id":27777,"date":"2022-11-22T11:18:15","date_gmt":"2022-11-22T11:18:15","guid":{"rendered":"http:\/\/create-a-custom-meetup-banner-in-nextjs"},"modified":"2023-10-30T12:01:03","modified_gmt":"2023-10-30T19:01:03","slug":"create-a-custom-meetup-banner-in-nextjs","status":"publish","type":"post","link":"https:\/\/cloudinary.com\/blog\/guest_post\/create-a-custom-meetup-banner-in-nextjs\/","title":{"rendered":"Create a Custom Meetup Banner in Next.js"},"content":{"rendered":"<div class=\"wp-block-cloudinary-markdown \"><p>Banners are a powerful marketing tool with numerous advantages. Whether it\u2019s preparing an event, attending a trade fair, or considering on-premise marketing, an outstanding banner is a necessity to set yourself apart from the competition.<\/p>\n<p>Physical event banners are one of the most effective kinds of outdoor advertising, so naturally digital event banners make a huge impression and convey the right message.<\/p>\n<p>This article describes how to build a custom meetup banner in Next.js.<\/p>\n<p>\nNext.js is a prominent React framework utilized for crafting full-stack web applications, encompassing both frontend and backend functionalities. It simplifies the tooling and configuration required for React, handling aspects like bundling and compiling to ensure a seamless development experience. Renowned for its static site generation capability, Next.js facilitates the creation of static web pages that are pre-rendered on build, cached, and delivered via a Content Delivery Network (CDN) for optimum loading speed. Moreover, it supports server-side rendering, another fast rendering method, to deliver a high-performance user experience. Notably, industry giants like TikTok, Hulu, and Nike have leveraged Next.js for their web development needs, attesting to its robust and scalable nature. According to a 2022 Statista report, both React and Next.js continue to rank among the most popular frameworks in the web development sphere.\n<\/p>\n<h2>CodeSandbox and GitHub<\/h2>\n<p>The completed project is on <a href=\"https:\/\/codesandbox.io\/s\/affectionate-breeze-5xuxju\/\">CodeSandbox<\/a>. Fork it to get started quickly.<\/p>\n<\/div>\n\n\n  <div class=\"wp-block-cloudinary-code-sandbox \">\n    <iframe\n      src=\"https:\/\/codesandbox.io\/embed\/affectionate-breeze-5xuxju?theme=dark&amp;codemirror=1&amp;highlights=&amp;editorsize=50&amp;fontsize=14&amp;expanddevtools=0&amp;hidedevtools=0&amp;eslint=0&amp;forcerefresh=0&amp;hidenavigation=0&amp;initialpath=%2F&amp;module=&amp;moduleview=0&amp;previewwindow=&amp;view=&amp;runonclick=1\"\n      height=\"500\"\n      style=\"width: 100%;\"\n      title=\"Create a custom meetup banner in Next.js\"\n      loading=\"lazy\"\n      allow=\"accelerometer; ambient-light-sensor; camera; encrypted-media; geolocation; gyroscope; hid; microphone; midi; payment; usb; vr; xr-spatial-tracking\"\n      sandbox=\"allow-forms allow-modals allow-popups allow-presentation allow-same-origin allow-scripts\"\n    ><\/iframe>\n  <\/div>\n\n\n<div class=\"wp-block-cloudinary-markdown \"><p>The source code is on <a href=\"https:\/\/github.com\/ugwutotheeshoes\/supabase-impression\">GitHub<\/a>.<\/p>\n<h2>Prerequisites<\/h2>\n<p>Adequate knowledge of JavaScript and React.js is required for following along with this article. A Cloudinary account is also needed \u2014 create one here. Knowledge of Next.js is not required but is preferred.<\/p>\n<h1>Getting Started with Next.js<\/h1>\n<p><a href=\"https:\/\/nextjs.org\/\">Next.js<\/a> is a React-based framework with functionalities like pre-rendering, automatic code-splitting for faster page loads, and API routes to build API endpoints with serverless functions for back-end features.<\/p>\n<p>Created by <a href=\"https:\/\/vercel.com\/\">Vercel<\/a>, Next.js is open source and based on <a href=\"https:\/\/nodejs.org\/\">Node.js<\/a> and <a href=\"https:\/\/babeljs.io\/\">Babel<\/a> \u2014 and also integrates with React to create single-page apps.<\/p>\n<h2>Project setup and installation<\/h2>\n<p>To create a new project, we\u2019ll run the following command in our terminal:<\/p>\n<pre class=\"js-syntax-highlighted\" aria-describedby=\"shcb-language-1\" data-shcb-language-name=\"HTML, XML\" data-shcb-language-slug=\"xml\"><span><code class=\"hljs language-xml shcb-wrap-lines\">    npx create-next-app <span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">project-name<\/span>&gt;<\/span>\n\n<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-1\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">HTML, XML<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">xml<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n<p>Next, we\u2019ll navigate into the project directory and start the development server with the command below:<\/p>\n<pre class=\"js-syntax-highlighted\" aria-describedby=\"shcb-language-2\" data-shcb-language-name=\"HTML, XML\" data-shcb-language-slug=\"xml\"><span><code class=\"hljs language-xml shcb-wrap-lines\">    cd <span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">project-name<\/span>&gt;<\/span> &amp;&amp; npm run dev\n<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-2\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">HTML, XML<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">xml<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n<p>Next.js will load the project at <code>http:\/\/localhost:3000<\/code> in our browser.<\/p>\n<h2>Setting up an image in Cloudinary<\/h2>\n<p>After successfully creating an account, Cloudinary will redirect us to our account\u2019s dashboard page, where we can upload the banner image.<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/cloudinary-marketing-res.cloudinary.com\/image\/upload\/c_limit,w_2000\/f_auto\/q_auto\/media_jams_sanity\/8af378c234ad4640d7e5f27211b9be6fb6018354-1366x663.png\" alt=\"image\" loading=\"lazy\" class=\"c-transformed-asset\"  width=\"1366\" height=\"663\"\/><\/p>\n<p>Click on the \u201cUpload\u201d button as shown above and select the image file to be uploaded.<\/p>\n<h2>Building the banner component<\/h2>\n<p>With our project fully set up and configured, we can start building the meetup banner.\nFirst, we\u2019ll create two state variables called <code>formData<\/code> and <code>display<\/code> in the <code>.\/pages\/index.js<\/code> file. <code>formData<\/code> stores the value of the input elements anytime it changes, and <code>display<\/code> provides a conditional rendering option to display the current banner details only if it is updated.<\/p>\n<pre class=\"js-syntax-highlighted\" aria-describedby=\"shcb-language-3\" data-shcb-language-name=\"JavaScript\" data-shcb-language-slug=\"javascript\"><span><code class=\"hljs language-javascript shcb-wrap-lines\">    <span class=\"hljs-comment\">\/\/ .\/pages\/index.js<\/span>\n    \n    <span class=\"hljs-keyword\">import<\/span> { useState } <span class=\"hljs-keyword\">from<\/span> <span class=\"hljs-string\">\"react\"<\/span>;\n    <span class=\"hljs-keyword\">import<\/span> styles <span class=\"hljs-keyword\">from<\/span> <span class=\"hljs-string\">\"..\/styles\/Home.module.css\"<\/span>;\n    \n    <span class=\"hljs-keyword\">export<\/span> <span class=\"hljs-keyword\">default<\/span> <span class=\"hljs-function\"><span class=\"hljs-keyword\">function<\/span> <span class=\"hljs-title\">Home<\/span>(<span class=\"hljs-params\"><\/span>) <\/span>{\n    <span class=\"hljs-keyword\">const<\/span> &#91;display, setDisplay] = useState(<span class=\"hljs-literal\">false<\/span>);\n      <span class=\"hljs-keyword\">const<\/span> &#91;formData, setFormData] = useState({\n        <span class=\"hljs-attr\">name<\/span>: <span class=\"hljs-string\">\"\"<\/span>,\n        <span class=\"hljs-attr\">speaker<\/span>: <span class=\"hljs-string\">\"\"<\/span>,\n        <span class=\"hljs-attr\">date<\/span>: <span class=\"hljs-string\">\"\"<\/span>,\n        <span class=\"hljs-attr\">time<\/span>: <span class=\"hljs-string\">\"\"<\/span>,\n        <span class=\"hljs-attr\">detail<\/span>: <span class=\"hljs-string\">\"\"<\/span>,\n      });\n    \n      <span class=\"hljs-keyword\">return<\/span> (\n        <span class=\"xml\"><span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">div<\/span> <span class=\"hljs-attr\">className<\/span>=<span class=\"hljs-string\">{styles.container}<\/span>&gt;<\/span>\n          <span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">main<\/span> <span class=\"hljs-attr\">className<\/span>=<span class=\"hljs-string\">{styles.main}<\/span>&gt;<\/span>\n          <span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">h1<\/span> <span class=\"hljs-attr\">className<\/span>=<span class=\"hljs-string\">{styles.title}<\/span>&gt;<\/span>event meetup banner<span class=\"hljs-tag\">&lt;\/<span class=\"hljs-name\">h1<\/span>&gt;<\/span>\n            <span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">div<\/span> <span class=\"hljs-attr\">className<\/span>=<span class=\"hljs-string\">\"run\"<\/span>&gt;<\/span>\n              \/\/ input elements and button\n            <span class=\"hljs-tag\">&lt;\/<span class=\"hljs-name\">div<\/span>&gt;<\/span>\n          <span class=\"hljs-tag\">&lt;\/<span class=\"hljs-name\">main<\/span>&gt;<\/span>\n        <span class=\"hljs-tag\">&lt;\/<span class=\"hljs-name\">div<\/span>&gt;<\/span><\/span>\n<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-3\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">JavaScript<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">javascript<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n<p>Next, we\u2019ll create a set of input elements and a button in the <code>.\/pages\/index.js<\/code> file. The input elements are to accept the input values \u2014 the banner details, while the button is to handle the functionality of the banner. We\u2019ll also bind the input values to the <code>formData<\/code> state variable to store the banner details.<\/p>\n<pre class=\"js-syntax-highlighted\" aria-describedby=\"shcb-language-4\" data-shcb-language-name=\"HTML, XML\" data-shcb-language-slug=\"xml\"><span><code class=\"hljs language-xml shcb-wrap-lines\">    \/\/ .\/pages\/index.js\n    \n    <span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">div<\/span> <span class=\"hljs-attr\">className<\/span>=<span class=\"hljs-string\">\"details\"<\/span>&gt;<\/span>\n      <span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">div<\/span> <span class=\"hljs-attr\">className<\/span>=<span class=\"hljs-string\">\"label\"<\/span>&gt;<\/span>\n        <span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">label<\/span>&gt;<\/span>event name<span class=\"hljs-tag\">&lt;\/<span class=\"hljs-name\">label<\/span>&gt;<\/span>\n        <span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">input<\/span>\n           <span class=\"hljs-attr\">type<\/span>=<span class=\"hljs-string\">\"text\"<\/span>\n           <span class=\"hljs-attr\">placeholder<\/span>=<span class=\"hljs-string\">\"name\"<\/span>\n           <span class=\"hljs-attr\">value<\/span>=<span class=\"hljs-string\">{formData.name}<\/span>\n           <span class=\"hljs-attr\">onChange<\/span>=<span class=\"hljs-string\">{handleChange}<\/span>\n        \/&gt;<\/span>\n      <span class=\"hljs-tag\">&lt;\/<span class=\"hljs-name\">div<\/span>&gt;<\/span>\n      <span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">div<\/span> <span class=\"hljs-attr\">className<\/span>=<span class=\"hljs-string\">\"label\"<\/span>&gt;<\/span>\n        <span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">label<\/span>&gt;<\/span>event speakers<span class=\"hljs-tag\">&lt;\/<span class=\"hljs-name\">label<\/span>&gt;<\/span>\n        <span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">input<\/span>\n          <span class=\"hljs-attr\">type<\/span>=<span class=\"hljs-string\">\"text\"<\/span>\n          <span class=\"hljs-attr\">placeholder<\/span>=<span class=\"hljs-string\">\"speaker\"<\/span>\n          <span class=\"hljs-attr\">value<\/span>=<span class=\"hljs-string\">{formData.speaker}<\/span>\n           <span class=\"hljs-attr\">onChange<\/span>=<span class=\"hljs-string\">{handleChange}<\/span>\n         \/&gt;<\/span>\n       <span class=\"hljs-tag\">&lt;\/<span class=\"hljs-name\">div<\/span>&gt;<\/span>\n       <span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">div<\/span> <span class=\"hljs-attr\">className<\/span>=<span class=\"hljs-string\">\"label\"<\/span>&gt;<\/span>\n        <span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">label<\/span>&gt;<\/span>date<span class=\"hljs-tag\">&lt;\/<span class=\"hljs-name\">label<\/span>&gt;<\/span>\n        <span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">input<\/span>\n           <span class=\"hljs-attr\">type<\/span>=<span class=\"hljs-string\">\"text\"<\/span>\n           <span class=\"hljs-attr\">value<\/span>=<span class=\"hljs-string\">{formData.date}<\/span>\n           <span class=\"hljs-attr\">onChange<\/span>=<span class=\"hljs-string\">{handleChange}<\/span>\n         \/&gt;<\/span>\n      <span class=\"hljs-tag\">&lt;\/<span class=\"hljs-name\">div<\/span>&gt;<\/span>\n      <span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">div<\/span> <span class=\"hljs-attr\">className<\/span>=<span class=\"hljs-string\">\"label\"<\/span>&gt;<\/span>\n         <span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">label<\/span>&gt;<\/span>time<span class=\"hljs-tag\">&lt;\/<span class=\"hljs-name\">label<\/span>&gt;<\/span>\n         <span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">input<\/span>\n           <span class=\"hljs-attr\">type<\/span>=<span class=\"hljs-string\">\"number\"<\/span>\n           <span class=\"hljs-attr\">value<\/span>=<span class=\"hljs-string\">{formData.time}<\/span>\n           <span class=\"hljs-attr\">onChange<\/span>=<span class=\"hljs-string\">{handleChange}<\/span>\n         \/&gt;<\/span>\n       <span class=\"hljs-tag\">&lt;\/<span class=\"hljs-name\">div<\/span>&gt;<\/span>\n       <span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">div<\/span> <span class=\"hljs-attr\">className<\/span>=<span class=\"hljs-string\">\"label\"<\/span>&gt;<\/span>\n         <span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">label<\/span>&gt;<\/span>Venue<span class=\"hljs-tag\">&lt;\/<span class=\"hljs-name\">label<\/span>&gt;<\/span>\n         <span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">textarea<\/span>\n           <span class=\"hljs-attr\">className<\/span>=<span class=\"hljs-string\">\"textarea\"<\/span>\n           <span class=\"hljs-attr\">type<\/span>=<span class=\"hljs-string\">\"text\"<\/span>\n           <span class=\"hljs-attr\">placeholder<\/span>=<span class=\"hljs-string\">\"type here\"<\/span>\n           <span class=\"hljs-attr\">value<\/span>=<span class=\"hljs-string\">{formData.detail}<\/span>\n           <span class=\"hljs-attr\">onChange<\/span>=<span class=\"hljs-string\">{handleChange}<\/span>\n          \/&gt;<\/span>\n          <span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">button<\/span>&gt;<\/span>Generate banner<span class=\"hljs-tag\">&lt;\/<span class=\"hljs-name\">button<\/span>&gt;<\/span>\n        <span class=\"hljs-tag\">&lt;\/<span class=\"hljs-name\">div<\/span>&gt;<\/span>\n    <span class=\"hljs-tag\">&lt;\/<span class=\"hljs-name\">div<\/span>&gt;<\/span>\n<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-4\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">HTML, XML<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">xml<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n<p>Next, we\u2019ll assign an <code>onChange<\/code> event listener to the input elements to update the values of <code>formData<\/code> as the input value changes.<\/p>\n<pre class=\"js-syntax-highlighted\"><code>      const handleChange = (e) =&gt; {\n        setFormData({ ...formData, [e.target.name]: e.target.value });\n        setDisplay(false);\n      };\n<\/code><\/pre>\n<p>Our meetup banner should look like this in our browser:<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/cloudinary-marketing-res.cloudinary.com\/image\/upload\/c_limit,w_2000\/f_auto\/q_auto\/media_jams_sanity\/2815dfe624fd4ec4654e8ac1ab980ff39ef814e9-1366x837.png\" alt=\"image\" loading=\"lazy\" class=\"c-transformed-asset\"  width=\"1366\" height=\"837\"\/><\/p>\n<p>We also need to handle the functionality of the banner to display only when we click on the \u201cgenerate banner\u201d button. To do so, we assign the button to an event that updates the <code>formData<\/code> with the current input values. The button also updates the <code>display<\/code> variable to <code>true<\/code> whenever we want to display the <code>formData<\/code> values.<\/p>\n<pre class=\"js-syntax-highlighted\" aria-describedby=\"shcb-language-5\" data-shcb-language-name=\"JavaScript\" data-shcb-language-slug=\"javascript\"><span><code class=\"hljs language-javascript shcb-wrap-lines\">     <span class=\"hljs-keyword\">const<\/span> handleSubmit = <span class=\"hljs-function\">(<span class=\"hljs-params\">e<\/span>) =&gt;<\/span> {\n        e.preventDefault();\n        setFormData({ ...formData });\n        setDisplay(<span class=\"hljs-literal\">true<\/span>);\n      };\n<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-5\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">JavaScript<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">javascript<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n<h2>Displaying data values<\/h2>\n<p>Here, we\u2019ll integrate our Cloudinary image as the background of our banner. So, we\u2019ll head over to Cloudinary to get the URL of the image. Before getting the URL, we\u2019ll apply some transformations to our image in Cloudinary by clicking on the \u201cedit\u201d button. The transformations are to achieve a specific image height and width.<\/p>\n<pre class=\"js-syntax-highlighted\" aria-describedby=\"shcb-language-6\" data-shcb-language-name=\"HTML, XML\" data-shcb-language-slug=\"xml\"><span><code class=\"hljs language-xml shcb-wrap-lines\"><span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">img<\/span> <span class=\"hljs-attr\">src<\/span>=<span class=\"hljs-string\">\"https:\/\/res.cloudinary.com\/ugwutotheeshoes\/image\/upload\/c_scale,h_450,w_750\/v1649721585\/pawel-czerwinski-dgJT71cXlC4-unsplash_usrnmt.jpg\"<\/span> <span class=\"hljs-attr\">alt<\/span>=<span class=\"hljs-string\">\"event image\"<\/span> \/&gt;<\/span>\n<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-6\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">HTML, XML<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">xml<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n<p>The code snippet above renders an image with a width of 750px and a height of 450px.\nAfter applying these changes, our application will look similar to this:<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/cloudinary-marketing-res.cloudinary.com\/image\/upload\/c_limit,w_2000\/f_auto\/q_auto\/media_jams_sanity\/41e77ee174307817ce737ae8f5d9a177fd03c73e-1366x837.png\" alt=\"image\" loading=\"lazy\" class=\"c-transformed-asset\"  width=\"1366\" height=\"837\"\/><\/p>\n<p>Add the following code to display the <code>formData<\/code> values if the <code>display<\/code> variable is <code>true<\/code>.<\/p>\n<pre class=\"js-syntax-highlighted\" aria-describedby=\"shcb-language-7\" data-shcb-language-name=\"HTML, XML\" data-shcb-language-slug=\"xml\"><span><code class=\"hljs language-xml shcb-wrap-lines\">    \/\/ .\/pages\/index.js\n    <span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">div<\/span> <span class=\"hljs-attr\">className<\/span>=<span class=\"hljs-string\">\"bad\"<\/span>&gt;<\/span>\n     <span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">img<\/span> <span class=\"hljs-attr\">src<\/span>=<span class=\"hljs-string\">\"https:\/\/res.cloudinary.com\/ugwutotheeshoes\/image\/upload\/c_scale,h_450,w_750\/v1649721585\/pawel-czerwinski-dgJT71cXlC4-unsplash_usrnmt.jpg\"<\/span> <span class=\"hljs-attr\">alt<\/span>=<span class=\"hljs-string\">\"event image\"<\/span> \/&gt;<\/span>\n        <span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">div<\/span> <span class=\"hljs-attr\">className<\/span>=<span class=\"hljs-string\">\"view\"<\/span>&gt;<\/span>\n          <span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">h1<\/span>&gt;<\/span>{display ? formData.name : \"\"}<span class=\"hljs-tag\">&lt;\/<span class=\"hljs-name\">h1<\/span>&gt;<\/span>\n          <span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">h3<\/span>&gt;<\/span>{display ? `speaker: ${formData.speaker}` : \"\"}<span class=\"hljs-tag\">&lt;\/<span class=\"hljs-name\">h3<\/span>&gt;<\/span>\n          <span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">p<\/span>&gt;<\/span> {display ? `date: ${formData.date}` : \"\"}<span class=\"hljs-tag\">&lt;\/<span class=\"hljs-name\">p<\/span>&gt;<\/span>\n          <span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">p<\/span>&gt;<\/span> {display ? `time: ${formData.time}pm` : \"\"}<span class=\"hljs-tag\">&lt;\/<span class=\"hljs-name\">p<\/span>&gt;<\/span>\n          <span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">p<\/span>&gt;<\/span>{display ? `venue: ${formData.detail}` : \"\"}<span class=\"hljs-tag\">&lt;\/<span class=\"hljs-name\">p<\/span>&gt;<\/span>\n        <span class=\"hljs-tag\">&lt;\/<span class=\"hljs-name\">div<\/span>&gt;<\/span>\n    <span class=\"hljs-tag\">&lt;\/<span class=\"hljs-name\">div<\/span>&gt;<\/span>\n\n<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-7\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">HTML, XML<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">xml<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n<p>We will also use some CSS styling in the <code>styles\/global.css<\/code> file.<\/p>\n<pre class=\"js-syntax-highlighted\" aria-describedby=\"shcb-language-8\" data-shcb-language-name=\"PHP\" data-shcb-language-slug=\"php\"><span><code class=\"hljs language-php shcb-wrap-lines\">    <span class=\"hljs-comment\">\/\/styles\/global.css<\/span>\n    .bad{\n      position: relative;\n      display: flex;\n      justify-content: center;\n      align-items: center;\n      text-align: center;\n    }\n    .view{\n      position: absolute;\n      top: <span class=\"hljs-number\">45<\/span>%;\n      left: <span class=\"hljs-number\">50<\/span>%;\n      transform: translate(<span class=\"hljs-number\">-50<\/span>%, <span class=\"hljs-number\">-50<\/span>%);\n      color: <span class=\"hljs-comment\">#000;<\/span>\n    }    \n<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-8\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">PHP<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">php<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n<p>In the code block above, we did the following:<\/p>\n<ul>\n<li>Positioned the child element relative to its parent element.<\/li>\n<li>Aligned the banner content in the middle of the banner.<\/li>\n<\/ul>\n<p>Our application should now look like this:<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/cloudinary-marketing-res.cloudinary.com\/image\/upload\/c_limit,w_2000\/f_auto\/q_auto\/media_jams_sanity\/e245507dbad3e62d1aa4cccc2865b9b26d60ab8e-1366x837.png\" alt=\"image\" loading=\"lazy\" class=\"c-transformed-asset\"  width=\"1366\" height=\"837\"\/><\/p>\n<h1>Conclusion<\/h1>\n<p>In this article, we learned how to build a meetup banner with Next.js.<\/p>\n<h1>Resources<\/h1>\n<ul>\n<li>\n<a href=\"https:\/\/cloudinary.com\/documentation\/react_quick_start\">Cloudinary React SDK Documentation<\/a>\n<\/li>\n<li>\n<a href=\"https:\/\/developer.mozilla.org\/en-US\/docs\/Web\/CSS\/position\">CSS Positioning<\/a>\n<\/li>\n<\/ul>\n<\/div>","protected":false},"excerpt":{"rendered":"","protected":false},"author":41,"featured_media":27778,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"_cloudinary_featured_overwrite":false,"footnotes":""},"categories":[1],"tags":[381,134,370,212,246,371],"class_list":["post-27777","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-uncategorized","tag-imagecdn","tag-guest-post","tag-image","tag-next-js","tag-react","tag-under-review"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v25.6 (Yoast SEO v26.9) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>Create a Custom Meetup Banner in Next.js<\/title>\n<meta name=\"description\" content=\"A digital event meetup banner built with Next.js\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/cloudinary.com\/blog\/guest_post\/create-a-custom-meetup-banner-in-nextjs\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Create a Custom Meetup Banner in Next.js\" \/>\n<meta property=\"og:description\" content=\"A digital event meetup banner built with Next.js\" \/>\n<meta property=\"og:url\" content=\"https:\/\/cloudinary.com\/blog\/guest_post\/create-a-custom-meetup-banner-in-nextjs\/\" \/>\n<meta property=\"og:site_name\" content=\"Cloudinary Blog\" \/>\n<meta property=\"article:published_time\" content=\"2022-11-22T11:18:15+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-10-30T19:01:03+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/res.cloudinary.com\/cloudinary-marketing\/images\/v1681922374\/Web_Assets\/blog\/5e3966b9f88a1472c35c16ba72aa4b41735ac386-4608x3456-1_27778a30c3\/5e3966b9f88a1472c35c16ba72aa4b41735ac386-4608x3456-1_27778a30c3-jpg?_i=AA\" \/>\n\t<meta property=\"og:image:width\" content=\"4608\" \/>\n\t<meta property=\"og:image:height\" content=\"3456\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"NewsArticle\",\"@id\":\"https:\/\/cloudinary.com\/blog\/guest_post\/create-a-custom-meetup-banner-in-nextjs\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/cloudinary.com\/blog\/guest_post\/create-a-custom-meetup-banner-in-nextjs\/\"},\"author\":{\"name\":\"\",\"@id\":\"\"},\"headline\":\"Create a Custom Meetup Banner in Next.js\",\"datePublished\":\"2022-11-22T11:18:15+00:00\",\"dateModified\":\"2023-10-30T19:01:03+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/cloudinary.com\/blog\/guest_post\/create-a-custom-meetup-banner-in-nextjs\/\"},\"wordCount\":8,\"publisher\":{\"@id\":\"https:\/\/cloudinary.com\/blog\/#organization\"},\"image\":{\"@id\":\"https:\/\/cloudinary.com\/blog\/guest_post\/create-a-custom-meetup-banner-in-nextjs\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/res.cloudinary.com\/cloudinary-marketing\/images\/f_auto,q_auto\/v1681922374\/Web_Assets\/blog\/5e3966b9f88a1472c35c16ba72aa4b41735ac386-4608x3456-1_27778a30c3\/5e3966b9f88a1472c35c16ba72aa4b41735ac386-4608x3456-1_27778a30c3.jpg?_i=AA\",\"keywords\":[\"(Image)CDN\",\"Guest Post\",\"Image\",\"Next.js\",\"React\",\"Under Review\"],\"inLanguage\":\"en-US\",\"copyrightYear\":\"2022\",\"copyrightHolder\":{\"@id\":\"https:\/\/cloudinary.com\/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/cloudinary.com\/blog\/guest_post\/create-a-custom-meetup-banner-in-nextjs\/\",\"url\":\"https:\/\/cloudinary.com\/blog\/guest_post\/create-a-custom-meetup-banner-in-nextjs\/\",\"name\":\"Create a Custom Meetup Banner in Next.js\",\"isPartOf\":{\"@id\":\"https:\/\/cloudinary.com\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/cloudinary.com\/blog\/guest_post\/create-a-custom-meetup-banner-in-nextjs\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/cloudinary.com\/blog\/guest_post\/create-a-custom-meetup-banner-in-nextjs\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/res.cloudinary.com\/cloudinary-marketing\/images\/f_auto,q_auto\/v1681922374\/Web_Assets\/blog\/5e3966b9f88a1472c35c16ba72aa4b41735ac386-4608x3456-1_27778a30c3\/5e3966b9f88a1472c35c16ba72aa4b41735ac386-4608x3456-1_27778a30c3.jpg?_i=AA\",\"datePublished\":\"2022-11-22T11:18:15+00:00\",\"dateModified\":\"2023-10-30T19:01:03+00:00\",\"description\":\"A digital event meetup banner built with Next.js\",\"breadcrumb\":{\"@id\":\"https:\/\/cloudinary.com\/blog\/guest_post\/create-a-custom-meetup-banner-in-nextjs\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/cloudinary.com\/blog\/guest_post\/create-a-custom-meetup-banner-in-nextjs\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/cloudinary.com\/blog\/guest_post\/create-a-custom-meetup-banner-in-nextjs\/#primaryimage\",\"url\":\"https:\/\/res.cloudinary.com\/cloudinary-marketing\/images\/f_auto,q_auto\/v1681922374\/Web_Assets\/blog\/5e3966b9f88a1472c35c16ba72aa4b41735ac386-4608x3456-1_27778a30c3\/5e3966b9f88a1472c35c16ba72aa4b41735ac386-4608x3456-1_27778a30c3.jpg?_i=AA\",\"contentUrl\":\"https:\/\/res.cloudinary.com\/cloudinary-marketing\/images\/f_auto,q_auto\/v1681922374\/Web_Assets\/blog\/5e3966b9f88a1472c35c16ba72aa4b41735ac386-4608x3456-1_27778a30c3\/5e3966b9f88a1472c35c16ba72aa4b41735ac386-4608x3456-1_27778a30c3.jpg?_i=AA\",\"width\":4608,\"height\":3456},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/cloudinary.com\/blog\/guest_post\/create-a-custom-meetup-banner-in-nextjs\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/cloudinary.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Create a Custom Meetup Banner in Next.js\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/cloudinary.com\/blog\/#website\",\"url\":\"https:\/\/cloudinary.com\/blog\/\",\"name\":\"Cloudinary Blog\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\/\/cloudinary.com\/blog\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/cloudinary.com\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/cloudinary.com\/blog\/#organization\",\"name\":\"Cloudinary Blog\",\"url\":\"https:\/\/cloudinary.com\/blog\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/cloudinary.com\/blog\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/res.cloudinary.com\/cloudinary-marketing\/images\/f_auto,q_auto\/v1649718331\/Web_Assets\/blog\/cloudinary_logo_for_white_bg_1937437aa7_19374666c7_193742f877\/cloudinary_logo_for_white_bg_1937437aa7_19374666c7_193742f877.png?_i=AA\",\"contentUrl\":\"https:\/\/res.cloudinary.com\/cloudinary-marketing\/images\/f_auto,q_auto\/v1649718331\/Web_Assets\/blog\/cloudinary_logo_for_white_bg_1937437aa7_19374666c7_193742f877\/cloudinary_logo_for_white_bg_1937437aa7_19374666c7_193742f877.png?_i=AA\",\"width\":312,\"height\":60,\"caption\":\"Cloudinary Blog\"},\"image\":{\"@id\":\"https:\/\/cloudinary.com\/blog\/#\/schema\/logo\/image\/\"}},{\"@type\":\"Person\",\"@id\":\"\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Create a Custom Meetup Banner in Next.js","description":"A digital event meetup banner built with Next.js","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/cloudinary.com\/blog\/guest_post\/create-a-custom-meetup-banner-in-nextjs\/","og_locale":"en_US","og_type":"article","og_title":"Create a Custom Meetup Banner in Next.js","og_description":"A digital event meetup banner built with Next.js","og_url":"https:\/\/cloudinary.com\/blog\/guest_post\/create-a-custom-meetup-banner-in-nextjs\/","og_site_name":"Cloudinary Blog","article_published_time":"2022-11-22T11:18:15+00:00","article_modified_time":"2023-10-30T19:01:03+00:00","og_image":[{"width":4608,"height":3456,"url":"https:\/\/res.cloudinary.com\/cloudinary-marketing\/images\/v1681922374\/Web_Assets\/blog\/5e3966b9f88a1472c35c16ba72aa4b41735ac386-4608x3456-1_27778a30c3\/5e3966b9f88a1472c35c16ba72aa4b41735ac386-4608x3456-1_27778a30c3-jpg?_i=AA","type":"image\/jpeg"}],"twitter_card":"summary_large_image","schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"NewsArticle","@id":"https:\/\/cloudinary.com\/blog\/guest_post\/create-a-custom-meetup-banner-in-nextjs\/#article","isPartOf":{"@id":"https:\/\/cloudinary.com\/blog\/guest_post\/create-a-custom-meetup-banner-in-nextjs\/"},"author":{"name":"","@id":""},"headline":"Create a Custom Meetup Banner in Next.js","datePublished":"2022-11-22T11:18:15+00:00","dateModified":"2023-10-30T19:01:03+00:00","mainEntityOfPage":{"@id":"https:\/\/cloudinary.com\/blog\/guest_post\/create-a-custom-meetup-banner-in-nextjs\/"},"wordCount":8,"publisher":{"@id":"https:\/\/cloudinary.com\/blog\/#organization"},"image":{"@id":"https:\/\/cloudinary.com\/blog\/guest_post\/create-a-custom-meetup-banner-in-nextjs\/#primaryimage"},"thumbnailUrl":"https:\/\/res.cloudinary.com\/cloudinary-marketing\/images\/f_auto,q_auto\/v1681922374\/Web_Assets\/blog\/5e3966b9f88a1472c35c16ba72aa4b41735ac386-4608x3456-1_27778a30c3\/5e3966b9f88a1472c35c16ba72aa4b41735ac386-4608x3456-1_27778a30c3.jpg?_i=AA","keywords":["(Image)CDN","Guest Post","Image","Next.js","React","Under Review"],"inLanguage":"en-US","copyrightYear":"2022","copyrightHolder":{"@id":"https:\/\/cloudinary.com\/#organization"}},{"@type":"WebPage","@id":"https:\/\/cloudinary.com\/blog\/guest_post\/create-a-custom-meetup-banner-in-nextjs\/","url":"https:\/\/cloudinary.com\/blog\/guest_post\/create-a-custom-meetup-banner-in-nextjs\/","name":"Create a Custom Meetup Banner in Next.js","isPartOf":{"@id":"https:\/\/cloudinary.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/cloudinary.com\/blog\/guest_post\/create-a-custom-meetup-banner-in-nextjs\/#primaryimage"},"image":{"@id":"https:\/\/cloudinary.com\/blog\/guest_post\/create-a-custom-meetup-banner-in-nextjs\/#primaryimage"},"thumbnailUrl":"https:\/\/res.cloudinary.com\/cloudinary-marketing\/images\/f_auto,q_auto\/v1681922374\/Web_Assets\/blog\/5e3966b9f88a1472c35c16ba72aa4b41735ac386-4608x3456-1_27778a30c3\/5e3966b9f88a1472c35c16ba72aa4b41735ac386-4608x3456-1_27778a30c3.jpg?_i=AA","datePublished":"2022-11-22T11:18:15+00:00","dateModified":"2023-10-30T19:01:03+00:00","description":"A digital event meetup banner built with Next.js","breadcrumb":{"@id":"https:\/\/cloudinary.com\/blog\/guest_post\/create-a-custom-meetup-banner-in-nextjs\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/cloudinary.com\/blog\/guest_post\/create-a-custom-meetup-banner-in-nextjs\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/cloudinary.com\/blog\/guest_post\/create-a-custom-meetup-banner-in-nextjs\/#primaryimage","url":"https:\/\/res.cloudinary.com\/cloudinary-marketing\/images\/f_auto,q_auto\/v1681922374\/Web_Assets\/blog\/5e3966b9f88a1472c35c16ba72aa4b41735ac386-4608x3456-1_27778a30c3\/5e3966b9f88a1472c35c16ba72aa4b41735ac386-4608x3456-1_27778a30c3.jpg?_i=AA","contentUrl":"https:\/\/res.cloudinary.com\/cloudinary-marketing\/images\/f_auto,q_auto\/v1681922374\/Web_Assets\/blog\/5e3966b9f88a1472c35c16ba72aa4b41735ac386-4608x3456-1_27778a30c3\/5e3966b9f88a1472c35c16ba72aa4b41735ac386-4608x3456-1_27778a30c3.jpg?_i=AA","width":4608,"height":3456},{"@type":"BreadcrumbList","@id":"https:\/\/cloudinary.com\/blog\/guest_post\/create-a-custom-meetup-banner-in-nextjs\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/cloudinary.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Create a Custom Meetup Banner in Next.js"}]},{"@type":"WebSite","@id":"https:\/\/cloudinary.com\/blog\/#website","url":"https:\/\/cloudinary.com\/blog\/","name":"Cloudinary Blog","description":"","publisher":{"@id":"https:\/\/cloudinary.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/cloudinary.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/cloudinary.com\/blog\/#organization","name":"Cloudinary Blog","url":"https:\/\/cloudinary.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/cloudinary.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/res.cloudinary.com\/cloudinary-marketing\/images\/f_auto,q_auto\/v1649718331\/Web_Assets\/blog\/cloudinary_logo_for_white_bg_1937437aa7_19374666c7_193742f877\/cloudinary_logo_for_white_bg_1937437aa7_19374666c7_193742f877.png?_i=AA","contentUrl":"https:\/\/res.cloudinary.com\/cloudinary-marketing\/images\/f_auto,q_auto\/v1649718331\/Web_Assets\/blog\/cloudinary_logo_for_white_bg_1937437aa7_19374666c7_193742f877\/cloudinary_logo_for_white_bg_1937437aa7_19374666c7_193742f877.png?_i=AA","width":312,"height":60,"caption":"Cloudinary Blog"},"image":{"@id":"https:\/\/cloudinary.com\/blog\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":""}]}},"jetpack_featured_media_url":"https:\/\/res.cloudinary.com\/cloudinary-marketing\/images\/f_auto,q_auto\/v1681922374\/Web_Assets\/blog\/5e3966b9f88a1472c35c16ba72aa4b41735ac386-4608x3456-1_27778a30c3\/5e3966b9f88a1472c35c16ba72aa4b41735ac386-4608x3456-1_27778a30c3.jpg?_i=AA","_links":{"self":[{"href":"https:\/\/cloudinary.com\/blog\/wp-json\/wp\/v2\/posts\/27777","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/cloudinary.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/cloudinary.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/cloudinary.com\/blog\/wp-json\/wp\/v2\/users\/41"}],"replies":[{"embeddable":true,"href":"https:\/\/cloudinary.com\/blog\/wp-json\/wp\/v2\/comments?post=27777"}],"version-history":[{"count":4,"href":"https:\/\/cloudinary.com\/blog\/wp-json\/wp\/v2\/posts\/27777\/revisions"}],"predecessor-version":[{"id":31682,"href":"https:\/\/cloudinary.com\/blog\/wp-json\/wp\/v2\/posts\/27777\/revisions\/31682"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/cloudinary.com\/blog\/wp-json\/wp\/v2\/media\/27778"}],"wp:attachment":[{"href":"https:\/\/cloudinary.com\/blog\/wp-json\/wp\/v2\/media?parent=27777"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/cloudinary.com\/blog\/wp-json\/wp\/v2\/categories?post=27777"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/cloudinary.com\/blog\/wp-json\/wp\/v2\/tags?post=27777"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}