
Security News
AGENTS.md Gains Traction as an Open Format for AI Coding Agents
AGENTS.md is a fast-growing open format giving AI coding agents a shared, predictable way to understand project setup, style, and workflows.
@beeper/matrix-widget-toolkit-mui
Advanced tools
A customized material-ui theme that matches the style of the Element Matrix client
@matrix-widget-toolkit/mui
This package provides a Mui theme that fits to the default Element theme. It provides:
matrix-widget-api
right now)Install it with:
yarn add @matrix-widget-toolkit/mui @mui/material
Now you can use it in your application:
import { WidgetApiImpl } from '@beeper/matrix-widget-toolkit-api';
import {
MuiThemeProvider,
MuiWidgetApiProvider,
} from '@matrix-widget-toolkit/mui';
import { Button } from '@mui/material';
// Initiate the widget API on startup. The Client will initiate
// the connection with `capabilities` and we need to make sure
// that the message doesn't get lost while we are initiating React.
const widgetApiPromise = WidgetApiImpl.create();
function App() {
return (
<MuiThemeProvider>
<MuiWidgetApiProvider widgetApiPromise={widgetApiPromise}>
<Button>A styled button</Button>
</MuiWidgetApiProvider>
</MuiThemeProvider>
);
}
export default App;
The matrix-widget-toolkit
uses i18next
to provide translations for messages.
To make it work in your widget you have to initialize it on your end.
See the i18next
getting started documentation.
This package provides a WidgetToolkitI18nBackend
containing the translation data.
You can use the ChainedBackend
plugin to load translation data for the matrix-widget-toolkit
together the translation data for the widget itself.
The package provides a WidgetApiLanguageDetector
that detects the language from the widget parameters with the i18next-browser-languagedetector
plugin.
For more details, see the implementation in the example widget.
You can hide child components till the user has approved all required capabilities:
import { MuiCapabilitiesGuard } from '@matrix-widget-toolkit/mui';
import { EventDirection, WidgetEventCapability } from '@beeper/matrix-widget-api';
<MuiCapabilitiesGuard
capabilities={[
WidgetEventCapability.forStateEvent(
EventDirection.Receive,
STATE_EVENT_ROOM_NAME
),
]}
>
/* Children are only displayed once the user has approved all capabilities. */
</MuiCapabilitiesGuard>;
You can override the primary color by setting the REACT_APP_PRIMARY_COLOR
environment variable.
Warning Choosing a different primary color might result in not meeting contrast requirements for accessability.
You can force the high contrast theme by setting the REACT_APP_FORCE_HIGH_CONTRAST_THEME
environment variable.
FAQs
A customized material-ui theme that matches the style of the Element Matrix client
The npm package @beeper/matrix-widget-toolkit-mui receives a total of 23 weekly downloads. As such, @beeper/matrix-widget-toolkit-mui popularity was classified as not popular.
We found that @beeper/matrix-widget-toolkit-mui demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
AGENTS.md is a fast-growing open format giving AI coding agents a shared, predictable way to understand project setup, style, and workflows.
Security News
/Research
Malicious npm package impersonates Nodemailer and drains wallets by hijacking crypto transactions across multiple blockchains.
Security News
This episode explores the hard problem of reachability analysis, from static analysis limits to handling dynamic languages and massive dependency trees.