
Security News
Axios Supply Chain Attack Reaches OpenAI macOS Signing Pipeline, Forces Certificate Rotation
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.
base-front-components
Advanced tools
基于 Next.js 15 和 shadcn/ui 构建的组件库。
# 使用 pnpm 安装(推荐)
pnpm add base-front-components
在应用入口处引入样式是确保组件显示正常的关键步骤:
// 在应用入口处引入(如 _app.js, layout.tsx 等)
import 'base-front-components/styles';
或在全局CSS文件中:
/* 在全局CSS文件中(如 globals.css) */
@import 'base-front-components/styles';
import { Button, Card } from 'base-front-components';
export default function MyComponent() {
return (
<div>
<Button>点击我</Button>
<Card>
<Card.Header>
<Card.Title>卡片标题</Card.Title>
<Card.Description>卡片描述</Card.Description>
</Card.Header>
<Card.Content>
卡片内容
</Card.Content>
</Card>
</div>
);
}
该组件库兼容 Tailwind CSS 3.4.3 版本。若您的项目使用 Tailwind CSS,请确保:
pnpm add -D tailwindcss@3.4.3 postcss autoprefixer
/** @type {import('tailwindcss').Config} */
module.exports = {
content: [
"./src/**/*.{js,ts,jsx,tsx}",
"./node_modules/base-front-components/**/*.{js,ts,jsx,tsx}"
],
theme: {
extend: {
// 您的自定义主题
}
},
plugins: []
};
module.exports = {
plugins: {
tailwindcss: {},
autoprefixer: {}
}
};
如果在其他项目中引入组件后样式未生效,请尝试以下解决方案:
确保样式已正确导入,并且导入位置在应用程序的入口文件中:
// _app.jsx 或 layout.tsx
import 'base-front-components/styles';
// 您的应用代码...
有时全局样式可能会被覆盖,您可以在使用组件的地方再次导入样式:
import { Button } from 'base-front-components';
import 'base-front-components/styles';
export default function MyComponent() {
return <Button>点击我</Button>;
}
如果您的项目使用CSS模块,可以创建一个专门的样式文件:
/* components-styles.css */
@import 'base-front-components/styles';
然后在组件中导入:
import './components-styles.css';
如果您的项目使用了shadcn/ui,确保在全局CSS文件的正确位置导入样式:
@tailwind base;
@tailwind components;
@tailwind utilities;
/* 导入组件库样式 - 放在Tailwind之后 */
@import 'base-front-components/styles';
/* 您的自定义样式 */
如果所有方法都不生效,组件库提供了CSS类,您可以直接应用到元素上:
<div className="card">
<div className="card-header">
<h3 className="card-title">标题</h3>
<p className="card-description">描述</p>
</div>
<div className="card-content">内容</div>
</div>
欢迎提交 PR 和 Issue。
MIT
FAQs
A component library built with Next.js 15 and shadcn/ui
We found that base-front-components demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer 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
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.

Security News
Open source is under attack because of how much value it creates. It has been the foundation of every major software innovation for the last three decades. This is not the time to walk away from it.

Security News
Socket CEO Feross Aboukhadijeh breaks down how North Korea hijacked Axios and what it means for the future of software supply chain security.