Code Monkey home page Code Monkey logo

react-fake-tweet's Introduction

Fake Tweet

Tweet React component. See a live demo.

Example

Fake tweet example

Installation

npm install @njrardin/react-fake-tweet

Usage

The following snippet is an example of use of the fake-tweet component:

import React from "react";
import FakeTweet from "fake-tweet";

function App() {
  const config = {
    user: {
      nickname: "twitter",
      name: "Twitter",
      avatar: "avatar.png",
      verified: true,
      locked: false
    },
    display: "default",
    text: "This is a fake tweet",
    image: "",
    date: "3:32 PM · Feb 14, 1997",
    app: "Twitter for iPhone",
    retweets: 32000,
    quotedTweets: 100,
    likes: 12700
  };
  return (
    <div className="App">
      <FakeTweet config={config} />
    </div>
  );
}

export default App;

You also need to pass a config object to the component with the following properties:

  • User:
    • Nickname: Twitter @username
    • Name
    • Avatar: Twitter avatar URL
    • Verified: Set to true to include the verified icon
    • Locked: Set to true to include the private account icon
  • Display: Twitter theme (default, dim or lightsout)
  • Text: The text the tweet will display
  • Image (optional): You can include an image to the tweet. Can be either a single URL string or an array of up to four URL strings for multiple images.
  • Date: A string that represents a date
  • App: For example, "Twitter for iPhone"
  • Retweets: Number of retweets
  • Quoted Tweets: Number of quoted tweets
  • Likes: Number of likes

react-fake-tweet's People

Contributors

lluiscamino avatar njrardin avatar dependabot[bot] avatar sno2 avatar dgca avatar sagar-gavhane avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.