score:0
Accepted answer
this document should get you started. most basic styling is available via configuration-settings.
the border of a textmessage for instance could be implemented via styleoptions:
<!doctype html>
<head>
<script src="https://cdn.botframework.com/botframework-webchat/latest/webchat.js"></script>
</head>
<body>
<div style="height: 60%; width: 40%; margin-top:5%; margin-left:10%" id="webchat" role="main"></div>
<script>
// set the css rules.
const styleset = window.webchat.createstyleset({
...
bubblebordercolor: '#e6e6e6',
bubbleborderradius: 2,
bubbleborderstyle: 'solid',
bubbleborderwidth: 1,
...
});
window.webchat.renderwebchat({
directline: window.webchat.createdirectline({
token: '<your direct line token>'}),
styleset
}, document.getelementbyid('webchat'));
</script>
</body>
score:0
botframework-webchat has a list of styleoptions that you can override located here:
https://github.com/microsoft/botframework-webchat/blob/main/packages/api/src/defaultstyleoptions.ts
it's possible to use webchat's activitymiddleware
to render your own custom message bubbles component:
const activitymiddleware = () => (next: any) => (...args) => {
const [card] = args;
if (card.activity) {
if (condition) {
return (
<div key={card.activity.id} classname='custom-class'>
{next(card)(children)}
</div>
)
}
}
}
...
return (
<reactwebchat
activitymiddleware={activitymiddleware}
directline={adapter}
styleoptions={styleoptions}
/>
);
Source: stackoverflow.com
Related Query
- How to customize BotFramework webchat react UI
- How to customize a column in react table 7
- How can I customize the style of a React component shared between lazy-loaded pages?
- How to customize Bootstrap variables in a React app?
- How to customize the header in GroupedList component in react ui-fabric library
- How to add AutoComplete/AutoSuggestion in Microsoft botframework webchat using React.js
- How to customize a component on React Bootstrap
- Issues with suggestion list in botframework Webchat React
- How to customize requests inside a React component
- How to customize style of React Recaptcha?
- how to customize react material ui next component
- how to customize the shape height and width of a component from the props using react
- How to make a menu in React WebChat by Microsoft Bot Framework?
- How to customize React Antd table header with table data?
- How to customize the scrollbar in React Js?
- How to customize checkbox with JSS in React
- How to customize dropdown item in react semantic-ui-react?
- How to stop an activity sending to directline webchat from React Js code
- How to customize Syncfusion React Scheduler component?
- In React Project, how to change and customize node modules
- How do I conditionally add attributes to React components?
- How to fix missing dependency warning when using useEffect React Hook
- How to update nested state properties in React
- How to push to History in React Router v4?
- How to call loading function with React useEffect only once
- How to use componentWillMount() in React Hooks?
- How can I communicate between related react components?
- React Router v4 - How to get current route?
- How to compare oldValues and newValues on React Hooks useEffect?
- How to use `setState` callback on react hooks
More Query from same tag
- React JS shopping cart add functions
- How to use Observable.if correctly in redux-observable?
- How can I resolver " useHref() may be used only in the context of a <Router> component" when component is already inside <Router>?
- Data not showing when load the page for the first time
- Map over two arrays and display data in a single table?
- Using React Jest Enzyme - How to pass a constructor object to my component with Shallow?
- React: Changing the background color of TreeSelect (antD component)
- Typescript + React: define a generic table component
- Where is the text coming from in my site's search results listing?
- React limits the number of renders to prevent an infinite loop
- Nested list using React
- How can I render a React component from server.js to App.js using post?
- JSON.parse( localStorage.getItem('priceSlider')).start , Unexpected end of JSON input
- GeoJSON marker is not showing on my leafletjs map
- How does GraphQL Mutation associate itself with Type
- React: Array of refs or array in ref.current
- OnSubmit not called if file not chosen
- TypeError: store.getState is not a function (redux)
- Reactjs + Material-ui , checkboxes not working
- Generate a unique id in react that persist
- React if statement in map inside JSX tag
- useEffect as componentDidUpdate with multiple dependencies
- Assignments to the 'timeInterval' variable from inside React Hook useEffect will be lost after each render
- ReactJS: doing calculations to setState, and updating
- data is not being sent by POST, reads OPTIONS in console
- How to use ProtectedRoute (RequireAuth) with fetch(url, method) in React (React Router v6)?
- importing DrawingManager from tomchentw/react-google-maps fails for create-react-app
- React-Redux: How do I set the initial state from the response of an asynchronous AJAX call?
- Export componenent after ajax call finishes in React
- How we change boolean state in redux