Skip to content
  • Unlock Pro
  • Log in with GitHub
Solution
Submitted about 3 years ago

Testimonial Grid (CRA & Tailwind CSS)

react, tailwind-css
Jade•105
@jadetrue
A solution to the Testimonials grid section challenge
View live sitePreview (opens in new tab)View codeCode (opens in new tab)

Solution retrospective


I'd love general feedback on this project.

The main area I'd love feedback on is how I've displayed the Cards. I've accessed the data individually rather than mapping through my array of objects - mainly because the styling is varied per card and with the layout, it made sense this way.

I am attempting to learn different sections of React at a time and I started off with context to be able to keep all my data in one file and pass it down to the components that need this information.

Code
Select a file

Please log in to post a comment

Log in with GitHub

Community feedback

  • Jacob•140
    @theschmocker
    Posted about 3 years ago

    Overall, looks great!

    Design-related thoughts:

    • There are a couple of profile images that aren't quite circles because the images themselves are not square. Something you may consider trying is to set an equal width and height on the image and applying "object-fit: cover". That will crop it to fit within the desired dimensions without making it squish.
    • Consider dropping into the single column layout a little sooner at intermediate sizes, some of the skinnier columns get pretty small. Or try experimenting with alternative multi-column layouts at those sizes that have a similar vibe as the large layout, but with less columns
    • Adding some padding to the container will help keep the content from hugging the edges of the screen on smaller mobile sizes
    • Setting a max width on the grid will help match the design more closely

    Semantics/Accessibility

    • A page should have a single h1. https://developer.mozilla.org/en-US/docs/Web/HTML/Element/Heading_Elements#multiple_h1_elements_on_one_page What I often do when there's not a clear heading for a page or section is to add one and hide it visually using an "sr-only" class, or similar. That helps to provide context to screenreader users that may be lost when relying on visual hierarchy alone
    • I think that have both sections of the testimonial (large, bold text and smaller text below in quotes) as h2s puts them too high within in the document hierarchy, especially given that theres no body content underneath them. Consider a document structure like
      • Visually hidden h1 for the page. Something like "Testimonials"
      • Names of people and their titles as wrapped in single h2s
      • Testimonial content in paragraph tags OR wrap both parts in a single blockquote element
    • The page content should be contained within a "main" landmark
    • The quote image in the first card should have an empty alt attribute to signify that it's purely decorative. Otherwise, it just adds noise for screenreaders. Consider doing the same for the thumbnails of the people; they don't add additional context for screenreaders that their name alone doesn't, so I would argue that they're also decorative.

    Card rendering thoughts I think the approach you've taken here is reasonable given the data provided. Here are some thoughts that I think might lead down some interesting paths:

    • All of the cards could be rendered in a loop and styled using "nth-child" selectors. This could be done in a way that would allow the layout to accommodate more or fewer testimonials
    • What if this data was being served from an API that you had control of, or you were in close contact with the developer that worked on the backend? Could you structure the data in such a way that specified where each item lived in the layout and/or how it should be styled?

    I hope this is useful!

    Marked as helpful

Join our Discord community

Join thousands of Frontend Mentor community members taking the challenges, sharing resources, helping each other, and chatting about all things front-end!

Join our Discord
Frontend Mentor logo

Stay up to datewith new challenges, featured solutions, selected articles, and our latest news

Frontend Mentor

  • Unlock Pro
  • Contact us
  • FAQs
  • Become a partner

Explore

  • Learning paths
  • Challenges
  • Solutions
  • Articles

Community

  • Discord
  • Guidelines

For companies

  • Hire developers
  • Train developers
© Frontend Mentor 2019 - 2025
  • Terms
  • Cookie Policy
  • Privacy Policy
  • License

Oops! 😬

You need to be logged in before you can do that.

Log in with GitHub

Oops! 😬

You need to be logged in before you can do that.

Log in with GitHub

How does the accessibility report work?

When a solution is submitted, we use axe-core to run an automated audit of your code.

This picks out common accessibility issues like not using semantic HTML and not having proper heading hierarchies, among others.

This automated audit is fairly surface level, so we encourage to you review the project and code in more detail with accessibility best practices in mind.

How does the CSS report work?

When a solution is submitted, we use stylelint to run an automated check on the CSS code.

We've added some of our own linting rules based on recommended best practices. These rules are prefixed with frontend-mentor/ which you'll see at the top of each issue in the report.

The report will audit all CSS, SCSS and Less files in your repository.

How does the HTML validation report work?

When a solution is submitted, we use html-validate to run an automated check on the HTML code.

The report picks out common HTML issues such as not using headings within section elements and incorrect nesting of elements, among others.

Note that the report can pick up “invalid” attributes, which some frameworks automatically add to the HTML. These attributes are crucial for how the frameworks function, although they’re technically not valid HTML. As such, some projects can show up with many HTML validation errors, which are benign and are a necessary part of the framework.

How does the JavaScript validation report work?

When a solution is submitted, we use eslint to run an automated check on the JavaScript code.

The report picks out common JavaScript issues such as not using semicolons and using var instead of let or const, among others.

The report will audit all JS and JSX files in your repository. We currently do not support Typescript or other frontend frameworks.

Oops! 😬

You need to be logged in before you can do that.

Log in with GitHub