flex-render
TypeScript icon, indicating that this package has built-in type declarations

0.1.4 • Public • Published

@iamprompt/flex-render

Utility to render LINE Flex Bubble / Carousel JSON for displaying in website.

Installation

pnpm add flex-render

Usage

You can input Flex Bubble / Carousel JSON from Flex Message Simulator directly to render function.

import { render } from "@iamprompt/flex-render";

const flexJSON = {
  "type": "bubble",
  "body": {
    "type": "box",
    "layout": "vertical",
    "contents": [
      {
        "type": "text",
        "text": "Brown Cafe",
        "weight": "bold",
        "size": "xl"
      }
    ]
  }
}

render(flexJSON)

Remark: Then output of render function can be used to render in any framework like React, Vue, Angular, etc. but importantly you need to import CSS file flex-render/css in your application.

You can see the example in apps directory.

Bugs

If you find a bug, please file an issue on our issue tracker on GitHub.

Package Sidebar

Install

npm i flex-render

Weekly Downloads

109

Version

0.1.4

License

MIT

Unpacked Size

119 kB

Total Files

7

Last publish

Collaborators

  • iamprompt