RE

React Intl

react-intl

Internationalize React apps. This library provides React components and an API to format dates, numbers, and strings, including pluralization and handling translations.

Forms
format
formatting
globalization
i18n
internationalization
intl
locale
localization
react
reactjs
Stars
1
Weekly
0
Open issues
0
Bundle
~60 kB

Installation

npm install react-intl

Code example

import { useIntl } from "react-intl";

export function Example() {
  const form = useIntl({ defaultValues: { email: "" } });

  function onSubmit(event: React.FormEvent<HTMLFormElement>) {
    event.preventDefault();
    console.log(form);
  }

  return (
    <form onSubmit={onSubmit}>
      <input name="email" type="email" placeholder="you@example.com" />
      <button type="submit">Submit</button>
    </form>
  );
}

Pros & cons

Pros

  • Actively maintained by Eric Ferraiuolo <edf@ericf.me>
  • 0 weekly downloads. Battle tested
  • First-class TypeScript definitions
  • BSD-3-Clause licensed

Considerations

  • Adds roughly ~60 kB to your bundle
  • Needs client-only rendering in SSR frameworks
  • Not supported in React Native
  • 0 open issues on GitHub

FAQs

Alternatives & similar libraries