Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/trendmicro-frontend/react-interpolate
A React component that renders elements into a format string containing replacement fields.
https://github.com/trendmicro-frontend/react-interpolate
Last synced: 26 days ago
JSON representation
A React component that renders elements into a format string containing replacement fields.
- Host: GitHub
- URL: https://github.com/trendmicro-frontend/react-interpolate
- Owner: trendmicro-frontend
- License: mit
- Created: 2017-01-17T11:25:43.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2023-09-22T14:04:57.000Z (over 1 year ago)
- Last Synced: 2024-12-29T14:39:01.117Z (27 days ago)
- Language: JavaScript
- Homepage: https://trendmicro-frontend.github.io/react-interpolate
- Size: 746 KB
- Stars: 6
- Watchers: 17
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome - react-interpolate - A React component that renders elements into a format string containing replacement fields ([demo](https://trendmicro-frontend.github.io/react-interpolate/)). (Trend Micro / React Components)
- awesome_frontend_development_resources - react-interpolate - A React component that renders elements into a format string containing replacement fields ([demo](https://trendmicro-frontend.github.io/react-interpolate/)). (Trend Micro / React Components)
- awesome_frontend_development_resources - react-interpolate - A React component that renders elements into a format string containing replacement fields ([demo](https://trendmicro-frontend.github.io/react-interpolate/)). (Trend Micro / React Components)
README
# react-interpolate [![build status](https://travis-ci.org/trendmicro-frontend/react-interpolate.svg?branch=master)](https://travis-ci.org/trendmicro-frontend/react-interpolate) [![Coverage Status](https://coveralls.io/repos/github/trendmicro-frontend/react-interpolate/badge.svg?branch=master)](https://coveralls.io/github/trendmicro-frontend/react-interpolate?branch=master)
[![NPM](https://nodei.co/npm/@trendmicro/react-interpolate.png?downloads=true&stars=true)](https://nodei.co/npm/@trendmicro/react-interpolate/)
A React component that renders elements into a format string containing replacement fields. It comes in handy when working with dynamic text elements like localized strings of a translation library.
Demo: https://trendmicro-frontend.github.io/react-interpolate
## Installation
1. Install the latest version of [react](https://github.com/facebook/react) and [react-interpolate](https://github.com/trendmicro-frontend/react-interpolate):
```
npm install --save react @trendmicro/react-interpolate
```2. Install [react-interpolate](https://github.com/trendmicro-frontend/react-interpolate)` with @trendmicro scope:
```js
import Interpolate from '@trendmicro/react-interpolate';
```## Usage
### Object Keys
```js
20
)
}}
>
{'{{number}} groups enabled'}```
### Array Keys
```js
{'2017-01-01T00:00:00Z'},
{'2017-01-10T23:59:59Z'}
]}
>
{'From {{0}} to {{1}}'}```
## API
### Properties
Name
Type
Default
Description
format
String
parent
String
'span'
prefix
String
{{
suffix
String
}}
replacement
Array|Object
## License
MIT