React Components

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

  • Renders an uncontrolled <select> element that uses a callback function to pass its value to the parent component.

  • Toggle

    React, Components

    Renders a toggle component.

  • Learn of all the different ways to set the value of a selected input in React with this quick guide.

  • Renders a textarea component with a character limit.

  • Spinning loader

    React, Components

    Renders a spinning loader component.

  • Tooltip

    React, Components

    Renders a tooltip component.

  • Collapsible content

    React, Components

    Renders a component with collapsible content.

  • Data list

    React, Components

    Renders a list of elements from an array of primitives.

  • Automatic text linking

    React, Components

    Renders a string as plaintext, with URLs converted to appropriate link elements.

  • React useUpdate hook

    React, Components

    Forces the component to re-render when called.

  • Learn the differences between PropTypes.objectOf() and PropTypes.shape() and where to use each one with this quick guide.

  • Controlled input field

    React, Components

    Renders a controlled <input> element that uses a callback function to inform its parent about value updates.

  • Uncontrolled range input

    React, Components

    Renders an uncontrolled range input element that uses a callback function to pass its value to the parent component.

  • Uncontrolled input field

    React, Components

    Renders an uncontrolled <input> element that uses a callback function to inform its parent about value updates.

  • Data table

    React, Components

    Renders a table with rows dynamically created from an array of primitives.