Skip to content

Files

Latest commit

b428d0a · Mar 11, 2025

History

History

components

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
Mar 11, 2025
Mar 11, 2024
Mar 24, 2021
Dec 3, 2024
May 28, 2024
Dec 6, 2024
Mar 8, 2024
Feb 12, 2025
Jan 16, 2025
Jan 16, 2025
Jan 16, 2025

opentrons components library

React components for Opentrons' applications. Visit the Opentrons Components Library to see available components.

example usage

import { PrimaryButton } from '@opentrons/components'

export default function CowButton(props) {
  return <PrimaryButton onClick={() => console.log('🐄')} />
}

setup

Usage requirements for dependent projects:

  • Node v22.11.0+ and yarn
  • The following dependencies (peer dependencies of @opentrons/components)
    • react: 17.0.1,
    • react-router-dom: ^4.2.2,
    • classnames: ^2.2.5,
    • lodash: ^4.17.4

contributing

Make sure you have read the top-level Contributing Guide.

unit tests

Unit tests are run with the rest of the repositories unit tests from the top level of the project.

make test-js

Unit tests live in a __tests__ directory in the same directory as the module under test. When writing unit tests for components, we've found the following tests to be the most useful:

  • DOM tests

    • Make sure the component renders the correct node type
    • Make sure DOM attributes are mapped correctly
    • Make sure handlers fire correctly
  • Render tests

    make test-js updateSnapshot=true