0.11.1 • Published 7 years ago
react-swagchat v0.11.1
swagchat UIKit (A set of React components)
swagchat is an open source chat components for your webapps.
This is UIKit for Chat API
Architecture
Related repositories
Installation
CDN
<script src="https://unpkg.com/react-swagchat/dist/react-swagchat.min.js"></script>
npm
npm install --save react-swagchat
Please use TypeScript for development.
react-swagchat provides its own type definitions, so you don't need @types/react-swagchat
installed!
Usage
Browser
Using the renderTemplateMessenger
function you can create the general chat UI (including screen transition).
<head>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/normalize/7.0.0/normalize.min.css" type="text/css" media="all">
<link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons" type="text/css" media="all">
<link rel="stylesheet" href="https://unpkg.com/react-swagchat/dist/react-swagchat.min.css">
</head>
<body>
<div id="swagchat" />
<script src="https://unpkg.com/react-swagchat/dist/react-swagchat.min.js"></script>
<script>
Swag.renderMessenger({
userId: 'USER_ID',
apiEndpoint: 'http://localhost:9000/v0',
});
</script>
</body>
Node
import { Avatar } from 'react-swagchat';
const AvatarExample = () => (
<Avatar
src="https://dummyimage.com/300x300/3768c4/fff&text=circle"
shape="circle"
onClick={() => alert("Click")}
/>
);
Development
npm install
npm run build:css (Create type definitions of css file)
npm run build:lib (for Node)
npm run cpx:css (Copy css and css.d.js file globs)
npm run build:dev (for Browser [development])
npm run build:prod (for Browser [production])
Build flow
License
MIT License.
0.11.1
7 years ago
0.11.0
7 years ago
0.10.3
8 years ago
0.10.2
8 years ago
0.10.1
8 years ago
0.10.0
8 years ago
0.9.4
8 years ago
0.9.3
8 years ago
0.9.2
8 years ago
0.9.1
8 years ago
0.9.0
8 years ago
0.8.17
8 years ago
0.8.16
8 years ago
0.8.15
8 years ago
0.8.14
8 years ago
0.8.13
8 years ago
0.8.12
8 years ago
0.8.11
8 years ago
0.8.10
8 years ago
0.8.9
8 years ago
0.8.8
8 years ago
0.8.7
8 years ago
0.8.6
8 years ago
0.8.5
8 years ago
0.8.4
8 years ago
0.8.3
8 years ago
0.8.2
8 years ago
0.8.1
8 years ago
0.8.0
8 years ago
0.7.5
8 years ago
0.7.4
8 years ago
0.7.3
8 years ago
0.7.2
8 years ago
0.7.1
8 years ago
0.7.0
8 years ago