2.0.2 • Published 9 years ago
apeman-react-chat v2.0.2
apeman-react-chat
apeman react package for chat components.
Installation
$ npm install apeman-react-chat --saveDemo
Live demo is hosted on GitHub Pages.
Usage
'use strict'
import React from 'react'
import {ApChat, ApChatItem, ApChatStyle} from 'apeman-react-chat'
const ExampleComponent = React.createClass({
render () {
return (
<div>
<ApChatStyle />
<ApChat>
<ApChatItem text="こんにちは"/>
<ApChatItem text={
`
むかしむかし、あるところに、おじいさんとおばあさんが住んでいました。
おじいさんは山へしばかりに、おばあさんは川へせんたくに行きました。
おばあさんが川でせんたくをしていると、ドンブラコ、ドンブラコと、大きな桃が流れてきました。
「おや、これは良いおみやげになるわ」
おばあさんは大きな桃をひろいあげて、家に持ち帰りました。
そして、おじいさんとおばあさんが桃を食べようと桃を切ってみると、なんと中から元気の良い男の赤ちゃんが飛び出してきました。
`
}/>
</ApChat>
</div>
)
}
})Components
ApChatItem
Props
| Name | Type | Default | Description | ||
|---|---|---|---|---|---|
| text | string | null | Balloon text | ||
| align | enum | 'left' | Align direction | ||
| info | array | string | null | Info texts |
ApChatStyle
Props
| Name | Type | Default | Description | |
|---|---|---|---|---|
| style | object | {} | ||
| highlightColor | string | ApStyle.DEFAULT_HIGHLIGHT_COLOR | ||
| backgroundColor | ApStyle.DEFAULT_BACKGROUND_COLOR |
ApChat
Props
| Name | Type | Default | Description |
|---|
License
This software is released under the MIT License.