Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@trendmicro/react-interpolate

Package Overview
Dependencies
Maintainers
2
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@trendmicro/react-interpolate

A React component that renders elements into a format string containing replacement fields.

  • 0.5.3
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1.3K
increased by2.94%
Maintainers
2
Weekly downloads
 
Created
Source

react-interpolate build status Coverage Status

NPM

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 and react-interpolate:
npm install --save react @trendmicro/react-interpolate
  1. Install react-interpolate` with @trendmicro scope:
import Interpolate from '@trendmicro/react-interpolate';

Usage

Object Keys

<Interpolate
    replacement={{
        number: (
            <span
                style={{
                    border: '1px solid #ccc',
                    padding: '5px 10px'
                }}
            >
                20
            </span>
        )
    }}
>
    {'{{number}} groups enabled'}
</Interpolate>

Array Keys

<Interpolate
    replacement={[
        <i>{'2017-01-01T00:00:00Z'}</i>,
        <i>{'2017-01-10T23:59:59Z'}</i>
    ]}
>
    {'From {{0}} to {{1}}'}
</Interpolate>

API

Properties

NameTypeDefaultDescription
formatString
parentString'span'
prefixString{{
suffixString}}
replacementArray|Object

License

MIT

Keywords

FAQs

Package last updated on 20 Apr 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc