React Snippets

The React snippet collection contains function components and reusable hooks for React 16.

  • Tag input field

    Renders a tag input field.

    React, Components · Nov 25, 2020

  • React rendering basics

    Take a deeper dive into React's rendering process and understand the basics behind the popular JavaScript framework.

    React, Render · Jun 12, 2021

  • Stateful checkbox with multiple selection

    Renders a checkbox list that uses a callback function to pass its selected value/values to the parent component.

    React, Components · Oct 13, 2021

  • Testing React components that update asynchronously with React Testing Library

    Testing React components that update asynchronously with React Testing Library is a common scenario. Learn how to deal with common issues and speed up your testing.

    React, Testing · Nov 7, 2021

  • Tabs

    Renders a tabbed menu and view component.

    React, Components · Oct 13, 2021

  • React rendering state

    Take a deeper dive into React's rendering process and understand the role of the Context API and Redux in it.

    React, Render · Jun 12, 2021

  • Textarea with word limit

    Renders a textarea component with a word limit.

    React, Components · Oct 13, 2021

  • Modal dialog

    Renders a Modal component, controllable through events.

    React, Components · Oct 13, 2021

  • Expandable object tree view

    Renders a tree view of a JSON object or array with collapsible content.

    React, Components · Nov 16, 2020

  • Collapsible accordion

    Renders an accordion menu with multiple collapsible content elements.

    React, Components · Oct 13, 2021

  • Button with ripple effect

    Renders a button that animates a ripple effect when clicked.

    React, Components · Oct 13, 2021

  • React rendering optimization

    Take a deeper dive into React's rendering process and understand how to make small yet powerful tweaks to optimize performance.

    React, Render · Jun 12, 2021

  • Closable alert

    Renders an alert component with type prop.

    React, Components · Jan 7, 2021

  • Star rating

    Renders a star rating component.

    React, Components · Oct 13, 2021

  • File drag and drop area

    Renders a file drag and drop component for a single file.

    React, Components · Oct 13, 2021