๐ช๐ต๐ฒ๐ป ๐๐ผ ๐จ๐๐ฒ ๐๐ถ๐ฏ๐ฟ๐ฎ๐ฟ๐ถ๐ฒ๐
Use native browser tools first. I still use libraries. The goal is not zero dependencies. The goal is no redundant ones.
Use a library when:
- It solves a problem the platform does not.
- It does one job.
- You would spend weeks building it yourself.
If the browser ships it, skip the library.
These libraries solve hard problems:
- sanitize-html: Stops XSS attacks. Rendering user HTML is a risk. Do not do this yourself.
- zod: Validates data at runtime. TypeScript vanishes when data enters your app. Zod keeps values safe.
- Floating UI: Handles complex positioning. It keeps panels on the screen. It does the math for you.
- marked: Turns markdown into HTML. It follows the spec. Use it and move on.
- Lucide: Provides a consistent icon set. It saves you from messy SVGs.
- fast-average-color: Finds the main color of an image. It is small and focused.
Use the same rule for everything.
Use a native dialog instead of a modal library. Use a library for hard problems the platform does not own.
Keep your list short. Stop building wheels you will build worse.
Use the platform for its strengths. Pay for help only where it earns it.
Source: https://dev.to/dimonb19a/the-libraries-i-actually-reach-for-and-the-rule-i-use-to-decide-2f82