Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Type-safe design systems with React & TypeScript

Avatar for Hammad Hassan Hammad Hassan
January 02, 2025
15

Type-safe design systems with React & TypeScript

I presented this talk on 18th of october 2024 at React Brussels Conference. It includes some animations so its better to view this on Google slides for much better experience.

Avatar for Hammad Hassan

Hammad Hassan

January 02, 2025
Tweet

Transcript

  1. • Software Engineer @ smotive • Love JavaScript Stack &

    Machine Learning • Frankfurt, Germany • Connect me on X (Twitter) @hmadhsan
  2. Agenda - Understanding the Design System - How React with

    TypeScript combined helps us to build better design systems
  3. When you hear designers refer to a design system, they're

    referring to the design language & visual components. When you hear developers refer to a Design System they're referring to the component library. A Design System is both of these wrapped in a style guide 💻 -Emma Wedeking (@Emmawedekind)
  4. Design System is a collection of shared visuals and reusable

    components to tie whole products together
  5. Dev is being told to create a new type of

    button for the 1000001th time
  6. Molecules in React Optional Props: placeholder is optional and TS

    ensures that component will work even if its not provided
  7. Ignoring Type Definitions - Skipping type definitions for props or

    using any excessively can lead to run-time errors - Always define types for props & states and avoid using any
  8. Overcomplicating Component Interfaces - Making component interfaces too complex can

    lead to confusion and misuse - Keep interfaces as simple as possible
  9. Mixing Concerns - Combining too many responsibilities in a single

    component can make it hard to maintain and test - Follow SRP & break down components
  10. Neglecting Accessibility - Don’t solely focus on type-safety & design

    - Use semantic HTML and ARIA attributes where needed.