
Security News
Bun 1.2.19 Adds Isolated Installs for Better Monorepo Support
Bun 1.2.19 introduces isolated installs for smoother monorepo workflows, along with performance boosts, new tooling, and key compatibility fixes.
@blocklet/ui-react
Advanced tools
Some useful front-end web components that can be used in Blocklets.
Some useful React components that can be used in Blocklets.
npm install @blocklet/ui-react
# or
yarn add @blocklet/ui-react
import Header from '@blocklet/ui-react/lib/Header';
import Footer from '@blocklet/ui-react/lib/Footer';
function App() {
return (
<div>
<Header />
...
<Footer />
</div>
);
}
<Header />
或 <Footer />
会获取 blocklet meta (window.blocklet
) 中的配置信息, 包括 app logo, app name, navigation links 等,然后基于这些配置信息渲染一个 page header 或 page footer。
如果 <Header />
上层存在 Session Context Provider,那么 Header 组件会在右侧区域自动渲染一个用户身份信息的按钮 (SessionManager)。
类似的,如果 <Header />
上层存在 Locale Context Provider,那么 Header 组件会在右侧区域自动渲染一个语言选择器按钮 (LocaleSelector)。
也可以显式地传入 blocklet meta:
const blockletMeta = {
appName: 'Blocklet Name',
appLogo: 'logo url',
theme: {
background: '#cfefe8',
},
navigation: [
{
title: 'Home',
link: '/',
},
...
],
};
function App() {
return (
<div>
<Header blockletMeta={blockletMeta} />
...
</div>
);
}
定制 Header 右侧 addons 区域:
<Header
blockletMeta={meta}
addons={addons => {
return [
<Button
variant="contained"
color="primary"
size="small"
style={{ marginRight: 8 }}>
Addons
</Button>,
<Button color="primary" size="small" style={{ marginRight: 8 }}>
Addons
</Button>,
...addons,
];
}}
/>
FAQs
Some useful front-end web components that can be used in Blocklets.
The npm package @blocklet/ui-react receives a total of 1,514 weekly downloads. As such, @blocklet/ui-react popularity was classified as popular.
We found that @blocklet/ui-react demonstrated a healthy version release cadence and project activity because the last version was released less than 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
Bun 1.2.19 introduces isolated installs for smoother monorepo workflows, along with performance boosts, new tooling, and key compatibility fixes.
Security News
Popular npm packages like eslint-config-prettier were compromised after a phishing attack stole a maintainer’s token, spreading malicious updates.
Security News
/Research
A phishing attack targeted developers using a typosquatted npm domain (npnjs.com) to steal credentials via fake login pages - watch out for similar scams.