<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Maryam</title>
    <description>The latest articles on DEV Community by Maryam (@maryamsulemani).</description>
    <link>https://dev.to/maryamsulemani</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F990230%2Fa810e592-3ba5-4823-a0ff-2f9d9c27b02a.png</url>
      <title>DEV Community: Maryam</title>
      <link>https://dev.to/maryamsulemani</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/maryamsulemani"/>
    <language>en</language>
    <item>
      <title>Prose linting with Vale</title>
      <dc:creator>Maryam</dc:creator>
      <pubDate>Mon, 06 Mar 2023 12:39:45 +0000</pubDate>
      <link>https://dev.to/meilisearch/prose-linting-with-vale-5hj3</link>
      <guid>https://dev.to/meilisearch/prose-linting-with-vale-5hj3</guid>
      <description>&lt;p&gt;Writing is a time-consuming process. Depending on the writer and the review process, it can take a while to get content ready for publication. Whether you’re a solo writer or a big team, prose linters can help ensure a consistent tone and style.&lt;/p&gt;

&lt;p&gt;Similar to code linters, prose linters automatically check your text for errors. Unlike grammar checkers, which highlight violations of grammatical rules, prose linters focus on how you can make your text better by addressing common usage problems like extra spaces, repeated words, excessive use of jargon, sexist language, and incorrect capitalization.&lt;/p&gt;

&lt;p&gt;Prose linters can also provide a framework for creating and enforcing an &lt;a href="https://www.writethedocs.org/guide/writing/style-guides"&gt;editorial style guide&lt;/a&gt;. This helps with the review process as you can now focus on reviewing the content itself instead of pointing out typos and preferred usage patterns. This is particularly important when working in open-source projects like Meilisearch, where you have many contributors unfamiliar with your style guide.&lt;/p&gt;

&lt;h2&gt;
  
  
  What is Vale?
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://vale.sh/docs/vale-cli/overview"&gt;Vale&lt;/a&gt; is an open-source, highly customizable, syntax-aware prose linter. It supports documents written in many different formats such as Markdown, HTML, reStructuredText, AsciiDoc, DITA, and XML.&lt;/p&gt;

&lt;p&gt;Vale isn’t your only option when it comes to prose linting. There are many other open-source tools available, including &lt;a href="http://proselint.com"&gt;proselint&lt;/a&gt;, &lt;a href="https://textlint.github.io"&gt;textlint&lt;/a&gt;, and &lt;a href="https://alexjs.com"&gt;alex&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;At Meilisearch, we decided to go with Vale because it’s fast, easy to set up, flexible, and comes with existing rules to help you get started.&lt;/p&gt;

&lt;h2&gt;
  
  
  Where do I start?
&lt;/h2&gt;

&lt;p&gt;Though it may seem daunting, setting up Vale can be fairly straightforward if you start small and keep things simple. In this post, we’ll go over how to use Vale in a project much like &lt;a href="https://github.com/meilisearch/documentation"&gt;Meilisearch’s documentation&lt;/a&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 1: Style guide
&lt;/h3&gt;

&lt;p&gt;The first step is to create a style guide. A style guide ensures a consistent tone and style regardless of how big your team gets. It establishes standard practices when people may have different opinions, such as whether or not to use the oxford comma.&lt;/p&gt;

&lt;p&gt;If you don’t have an in-house style guide, you can check out &lt;a href="https://developers.google.com/style"&gt;Google’s&lt;/a&gt; or &lt;a href="https://learn.microsoft.com/en-us/style-guide/welcome"&gt;Microsoft’s&lt;/a&gt; to help you get started. Over time you will memorize most of the rules, but it’s possible to overlook mistakes and sometimes forget the rules altogether. We’re only human.&lt;/p&gt;

&lt;p&gt;And that is where Vale comes in. It allows you to “codify” a style guide and checks your text against all the rules in that style guide. If it detects any issues, it displays suggestions, warnings, or errors on the console.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--KG3BcvIs--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/34zw6a84618pv5jz37l5.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--KG3BcvIs--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/34zw6a84618pv5jz37l5.png" alt="Vale output showing errors, warnings, and suggestions" width="880" height="415"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 2: Install Vale
&lt;/h3&gt;

&lt;p&gt;I’m using macOS and ran &lt;code&gt;brew install vale&lt;/code&gt; in my console to install Vale.&lt;/p&gt;

&lt;p&gt;If you’re using a different operating system, check out Vale’s documentation for &lt;a href="https://vale.sh/docs/vale-cli/installation"&gt;installation instructions&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Verify the installation by typing  &lt;code&gt;vale -v&lt;/code&gt; in your console. If this command returns Vale’s version number, the installation was successful.&lt;/p&gt;

&lt;p&gt;Finally, create the following files and folders:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;├── .vale.ini
│   ├──  styles
│   │       ├── Style guide
│   │       └── Vocab
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Step 3: Configuring Vale - vale.ini
&lt;/h3&gt;

&lt;p&gt;Create a &lt;code&gt;vale.ini&lt;/code&gt; file at the root of your repository. This is the Vale configuration file where you define what you want Vale to do and what files to lint. Let’s start with a basic setup—you can always add to it later based on your project’s needs.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;StylesPath = .vale/styles
MinAlertLevel = suggestion

Vocab = word_list

[*.md]
BasedOnStyles = Meilisearch
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;StylesPath&lt;/code&gt; is where Vale looks for your style guide (more on that in the next step). The path can be relative or absolute to the location of the &lt;code&gt;vale.ini&lt;/code&gt; file.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;MinAlertLevel&lt;/code&gt; specifies the minimum alert level that Vale will report. By default, it’s set to &lt;code&gt;warning&lt;/code&gt;. The other options are &lt;code&gt;error&lt;/code&gt; and &lt;code&gt;suggestion&lt;/code&gt;.
An error indicates you did something wrong, like using extra spaces or making a typo. A warning isn’t as severe as an error, but indicates something you should avoid, like making sure your sentences don’t become too long. A suggestion is a recommendation to do something that is usually—but not always—a good idea, like breaking your sentence into two instead of using a semicolon.
If a rule is set to &lt;code&gt;suggestion&lt;/code&gt;, you will see suggestions, warnings, and errors. If it is set to &lt;code&gt;warning&lt;/code&gt;, Vale will only show errors and warnings, no suggestions.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;Vocab&lt;/code&gt;: This is where you create a directory containing the &lt;code&gt;accept.txt&lt;/code&gt; and &lt;code&gt;reject.txt&lt;/code&gt; files. Both files accept words, phrases, and &lt;a href="https://ubuntu.com/blog/regex-basics"&gt;regular expressions&lt;/a&gt;. If your text contains words that do not exist in the dictionary (e.g. “Meilisearch”), you can add them to &lt;code&gt;accept.txt&lt;/code&gt; and Vale won’t angrily scream at you for making a “typo”. Vale will flag all occurrences listed in &lt;code&gt;reject.txt&lt;/code&gt; as errors. This can be useful when you want writers to avoid a specific word—if you are writing about search engines and databases, for example, using “indexation” can be confusing.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;[*.md]&lt;/code&gt; tells Vale to only lint markdown files. If you want to lint plain text files, use &lt;code&gt;[*.txt]&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;BasedOnStyles&lt;/code&gt; specifies the style guide Vale should use for linting.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;You can specify other settings, including what tokens and HTML tags to ignore and what Vale should consider an individual word. You can read more about the &lt;code&gt;vale. ini&lt;/code&gt; file in &lt;a href="https://vale.sh/docs/topics/config"&gt;Vale’s documentation&lt;/a&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 4: Rules and the styles folder
&lt;/h3&gt;

&lt;p&gt;As I mentioned earlier, you need a style guide to use Vale. You then convert this style guide into something Vale can understand: rules.&lt;/p&gt;

&lt;p&gt;Rules use different &lt;a href="https://vale.sh/docs/topics/styles"&gt;extension points&lt;/a&gt; to perform specific tasks. For example, the &lt;code&gt;existence&lt;/code&gt; extension point looks for the existence of a particular token, &lt;code&gt;repetition&lt;/code&gt; looks for repeated tokens, &lt;code&gt;spelling&lt;/code&gt; implements spell checking, and so on. In Vale, each rule is a YAML file. The &lt;code&gt;styles&lt;/code&gt; folder contains the individual rules that make up the style guide.&lt;/p&gt;

&lt;p&gt;If you don’t want to create your own style guide or need a starting point to build from, Vale comes with ready-to-use style guides that you can apply to your docs and start linting. Here are some style guides that helped us get started:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://github.com/errata-ai/Google"&gt;Google&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://gitlab.com/gitlab-org/gitlab/-/tree/master/doc/.vale/gitlab"&gt;GitLab&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/redhat-documentation/vale-at-red-hat/tree/main/.vale/styles/RedHat"&gt;RedHat&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;You can find more on &lt;a href="https://github.com/errata-ai/packages"&gt;Vale’s GitHub repository&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Let’s start with a rule for sentence length. Your style would say something like, “Ensure sentences don’t exceed 40 words”. This is what the rule looks like as a YAML file:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# Warning: Meilisearch.SentenceLength

# Counts words in a sentence and alerts if a sentence exceeds 40 words.

extends: occurrence
message: 'Shorter sentences improve readability (max 40 words).'
scope: sentence
link: https://docs.gitlab.com/ee/development/documentation/styleguide/index.html#language
level: warning
max: 40
token: \b(\w+)\b
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This rule counts the words in a sentence and throws a warning if it exceeds 40 words. The &lt;code&gt;scope&lt;/code&gt; is set to &lt;code&gt;sentence&lt;/code&gt;: this ensures that Vale does not apply this rule to other parts of the text, like headings or tables.&lt;/p&gt;

&lt;p&gt;The &lt;code&gt;level&lt;/code&gt; is set to &lt;code&gt;warning&lt;/code&gt;. Written text is complicated, and Vale will find false positives. There are no sure-fire ways of deciding when a rule should be a suggestion, warning, or an error. You will need to make decisions and learn as you go.&lt;/p&gt;

&lt;p&gt;I suggest reviewing your rules over time to update and, in some cases, delete outdated rules. Initially, the Meilisearch docs didn’t have a rule on sentence length. When we added it, the maximum length of a sentence was 45. Now it’s 40, and we plan on bringing it down to 35.&lt;/p&gt;

&lt;p&gt;You can also enable or disable specific rules within a style guide by adding them to &lt;code&gt;vale.ini&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Meilisearch.Headings = NO
Meilisearch.Spelling = NO
Meilisearch.Semicolons = NO
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The above lines disable the Heading, Spelling, and Semicolons rules from the &lt;a href="https://github.com/meilisearch/documentation/tree/main/.vale/styles"&gt;Meilisearch style guide&lt;/a&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 5: Run Vale
&lt;/h3&gt;

&lt;p&gt;Now, when you use the following command on your console to lint your whole project:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;vale .
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Vale will check all your files against the rules stored in &lt;code&gt;BasedOnStyles&lt;/code&gt;. If Vale detects any issues, it will display suggestions, warnings, and errors on the console.&lt;/p&gt;

&lt;p&gt;You can also lint individual files using:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;vale {file_path}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Step 6: Automate Vale checks
&lt;/h3&gt;

&lt;p&gt;All the checks we’ve discussed so far are for your local files. Once you’re confident the rules work as intended, you can automate these checks using the &lt;a href="https://github.com/errata-ai/vale-action"&gt;Vale GitHub action&lt;/a&gt;! At the Meilisearch documentation repository, we configured it to run for every pull request. As mentioned before, Vale may find false positives. Since you don’t want a PR blocked because Vale isn’t working as it should, I recommend starting with a few rules, and slowly tweaking them to avoid failing checks.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;That is all, folks! I hope I was able to help you get started with Vale (and a style guide). This was a quick overview to introduce you to Vale’s features. Tweaking it to your needs takes time and many, &lt;em&gt;many&lt;/em&gt; iterations.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--nQS5rcxS--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/dy451v4nhu8k68vv88d1.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--nQS5rcxS--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/dy451v4nhu8k68vv88d1.gif" alt="Tired brain" width="496" height="258"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Once configured, Vale can automate parts of the review process and allow you to focus on the parts of a text that computers are not very good at. At least not yet.&lt;/p&gt;

&lt;p&gt;Oh, and if you’re curious, check out &lt;a href="https://github.com/meilisearch/documentation/tree/main/.vale/styles"&gt;our style guide on GitHub&lt;/a&gt; to see how we use Vale!&lt;/p&gt;

</description>
      <category>vale</category>
      <category>proselinter</category>
      <category>styleguide</category>
    </item>
    <item>
      <title>Navigating search results: pagination vs infinite scroll vs load more</title>
      <dc:creator>Maryam</dc:creator>
      <pubDate>Thu, 15 Dec 2022 13:00:01 +0000</pubDate>
      <link>https://dev.to/meilisearch/navigating-search-results-pagination-vs-infinite-scroll-vs-load-more-m90</link>
      <guid>https://dev.to/meilisearch/navigating-search-results-pagination-vs-infinite-scroll-vs-load-more-m90</guid>
      <description>&lt;p&gt;Meilisearch v0.30 is out and brings with it the ability to create numbered page selectors. You can read more about the new features and updates from v0.30 in our &lt;a href="https://blog.meilisearch.com/whats-new-in-v0-30/" rel="noopener noreferrer"&gt;release blog post&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;This article will go over the different ways of navigating search results and the pros and cons of each method.&lt;/p&gt;

&lt;h2&gt;
  
  
  What is pagination, and what are some common alternatives?
&lt;/h2&gt;

&lt;p&gt;Let’s say you go to an ecommerce website to buy a new pair of shoes. It would be quite overwhelming if you got 700 pairs of shoes to choose from as soon as the page loads—not to mention that fetching every pair of shoes would certainly slow down the site.&lt;/p&gt;

&lt;p&gt;To avoid this, most websites will break search results up into chunks, such as pages, and load a certain number at a time based on input from the user.&lt;/p&gt;

&lt;p&gt;There are three main ways to display large datasets: pagination, infinite scroll, and load more. Each method has benefits and downsides that make it suited for certain use cases and content types. For example, Google’s use of numbered pagination makes it easier to find a specific result again, while Twitter, Facebook, and Instagram use infinite scroll to keep users glued to their screens. Google uses load more on mobile devices to display search results.&lt;/p&gt;

&lt;p&gt;Changing from one type of pagination to another can completely alter user experience.  Imagine waking up to a paginated version of Twitter, where you have to continuously click a “Next” button to view more posts in your feed (thanks, Elon). This would completely change the way you interact with the site!&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fa172aijbnmyvxbfj9hl1.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fa172aijbnmyvxbfj9hl1.gif" alt="Image description" width="498" height="498"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In making the choice of how to display search results, you decide how much content to show users at one time, what action they have to take to view more, and how convenient it is to find a specific result again.&lt;/p&gt;

&lt;h2&gt;
  
  
  Pagination
&lt;/h2&gt;

&lt;p&gt;Pagination works by breaking search results down into separate pages. There are two main types of pagination interfaces: numbered ones, where you find a list of numbered pages at the bottom of each page, and unnumbered ones, where you navigate from page to page using the “Previous” and “Next” buttons.&lt;/p&gt;

&lt;p&gt;Pagination is one of the most popular ways to display search results and is particularly common on ecommerce websites. Pagination breaks down content, making it easier to process. Since each page is distinct, users can easily return to items they liked or share them with others. This helps users to search for something specific instead of browsing through a never-ending list of items.&lt;/p&gt;

&lt;p&gt;The biggest downside to pagination is that most users don’t look beyond the first few pages and hence never get to look at more results. When was the last time you went to the second page of Google’s search results?&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fk3mdcxokyo2iym1j9vf5.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fk3mdcxokyo2iym1j9vf5.gif" alt="Thinking Pooh" width="498" height="277"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Since the results are replaced with every new page, users need to switch between pages to compare results. In addition, pagination isn’t very mobile-friendly. Mobile users prefer load more or infinite scroll as it’s more intuitive. It also requires additional actions from the user: clicking the “Next” button and waiting for the page to load. This may also give the impression that pagination is slow.&lt;/p&gt;

&lt;h3&gt;
  
  
  Numbered page selection
&lt;/h3&gt;

&lt;p&gt;Page numbers add clarity to the search process and guide users to what they’re searching for. Numbered page selection offers numerous advantages, such as:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Users can be shown the total number of pages of results, allowing them to estimate how long they will need to find a particular item. (“I have 25 pages worth of shoes to sift through!”)&lt;/li&gt;
&lt;li&gt;With numbered pages, it’s clear that some pages are more relevant than others. (“I didn’t find those shoes on the first five pages, so this website probably doesn’t sell them.”)&lt;/li&gt;
&lt;li&gt;Users can remember the positioning of an item, and numbered pages allow them to return to it faster. (“I liked the pink shoes on page 3.”)&lt;/li&gt;
&lt;li&gt;Users can generally stop in the middle of a session and continue from where they left off. (“I stopped at page 5 yesterday.”)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Frgu0k6khznr9swzrcwr9.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Frgu0k6khznr9swzrcwr9.png" alt="Numbered pagination" width="718" height="162"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  “Previous” and “Next” buttons
&lt;/h3&gt;

&lt;p&gt;In numberless pagination, users navigate via “Next” and “Previous” buttons instead of a list of numbered pages. This alternative to numbered pagination is often used for mobile displays where there isn’t enough space to display page numbers. Since there are only two buttons, it offers less precision, as users can’t jump to specific pages. However, it offers better performance as it isn’t necessary to calculate the total number of search results.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fpcs9y65xvr54jslr14zv.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fpcs9y65xvr54jslr14zv.png" alt="" width="800" height="435"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Infinite scroll
&lt;/h2&gt;

&lt;p&gt;Infinite scroll has become increasingly popular over the past decade due to the rise in smartphones. It loads more content seamlessly as the user scrolls, reducing friction. It’s also more intuitive than pagination; you just keep scrolling to view more content! Additionally, since all the content is loaded to a single page, it may seem faster than traditional pagination.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fb08fgmdjl7p2nxw26rqh.GIF" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fb08fgmdjl7p2nxw26rqh.GIF" alt="Infinite scroll gif" width="600" height="600"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The biggest downside to infinite scroll is poor usability.  The page length increases infinitely, making it difficult to find previously viewed results again, nor can users bookmark or share a particular set of items on the list.  Page performance slows down as more content is loaded, making the page “heavier”. Meanwhile, the site footer may be inaccessible since infinite scroll pushes it endlessly down as more content is loaded. Since Googlebot cannot emulate scrolling, infinite scroll also has a negative impact on SEO.&lt;/p&gt;

&lt;p&gt;However, the greatest impact by far is on user behavior. At some point, users of infinite scroll will stop paying attention to individual results and begin to focus more on scrolling, leading to decreased engagement. You can read more about this in &lt;a href="https://www.smashingmagazine.com/2016/03/pagination-infinite-scrolling-load-more-buttons/" rel="noopener noreferrer"&gt;Baymard Institute's study&lt;/a&gt; on design patterns for loading products on desktops and mobile devices.&lt;/p&gt;

&lt;p&gt;Based on the above, infinite scroll may not be the best solution for ecommerce websites. How do you find the pink shoes you liked 15-ish scrolls ago?&lt;/p&gt;

&lt;p&gt;There is one use case where infinite scroll cannot be beat. For entertainment websites whose main purpose is to keep the users with no particular aim on the page for as long as possible, infinite scroll all but guarantees a longer time on site. This is why infinite scroll is closely linked with social media and other business models that rely on advertising or data harvesting.&lt;/p&gt;

&lt;h2&gt;
  
  
  Load more
&lt;/h2&gt;

&lt;p&gt;Like infinite scroll, load more is a mobile-friendly option that works by extending one page infinitely. However, unlike infinite scroll, load more allows users to choose whether they want to view more results by clicking a “Load more” button at the bottom of the page. This critical difference gives users more control, making it easier, for example, to access the footer or keep track of a specific result. Studies show that it also increases the amount of attention users give to each individual item.&lt;/p&gt;

&lt;p&gt;Load more shares many downsides with infinite scroll, such as poor page performance. Like infinite scroll, it’s not ideal for SEO as Googlebot cannot click the “Load more” button. This means it cannot crawl or index all of your content.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F3585dkshtt7g4o1tqmal.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F3585dkshtt7g4o1tqmal.png" alt="Load more pagination" width="800" height="427"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  So, what do I use?
&lt;/h2&gt;

&lt;p&gt;The short answer: it depends on the kind of product experience you want.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Pagination&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Your users are looking for highly specific results&lt;/li&gt;
&lt;li&gt;SEO is very important to you&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Infinite scroll&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;You’re building a social media site&lt;/li&gt;
&lt;li&gt;Your users want to explore a large amount of content&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Load more&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;You want to hide your content behind a paywall&lt;/li&gt;
&lt;li&gt;You want to build an ethical mobile experience&lt;/li&gt;
&lt;li&gt;You want to gain some of the benefits of both pagination and infinite scroll&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Or you could go hybrid! Consider Ikea: they use a load more button but also display the total number of search results and a progress bar, enabling users to see how many results they’ve viewed so far.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fu9vlfnyy6gcf9e8ur947.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fu9vlfnyy6gcf9e8ur947.png" alt="Hybrid pagination" width="800" height="358"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;While we have covered the three main ways to display search results today, they are far from set in stone. At the end of the day, your goal is to help your users find the content they need. If you understand which key goals you want to accomplish with your search navigation interface and which pitfalls you want to avoid, you may be able to design something even better than what’s been done before. Good luck, and let us know what you create with Meilisearch!&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>webdev</category>
    </item>
  </channel>
</rss>
