Flowbite + Meteor.js 통합
Meteor.js는 현대 웹·모바일 애플리케이션을 개발하기 위한 풀스택 JavaScript 플랫폼이에요. 연결된 클라이언트 반응형 애플리케이션을 만들기 위한 핵심 기술, 빌드 도구, Node.js와 JavaScript 커뮤니티에서 선별한 패키지 집합을 포함합니다. Meteor.js의 풀스택 리액티비티, Tailwind CSS의 유틸리티 우선 접근, Flowbite의 오픈소스 UI 컴포넌트를 함께 사용하면 현대적인 UI 웹 애플리케이션을 빠르게 구축할 수 있어요.
출처: 문서
본문
시작하기 (Getting started)
가장 빠르게 시작하는 방법은 프로젝트 생성 CLI를 사용하는 것이에요. Flowbite React, Tailwind CSS, 필요한 모든 설정을 갖춘 새 Meteor 프로젝트를 만들어 줍니다.
Meteor.js 프로젝트 만들기 (Create a Meteor.js project)
Flowbite React CLI 툴킷에서 다음 명령을 사용하면 새 Meteor 프로젝트를 만들고 Tailwind CSS를 설치·설정하며 Flowbite React와 그 의존성을 구성하고 다크 모드와 예시 컴포넌트까지 추가해 줍니다.
npx create-flowbite-react@latest -t meteorjs
기존 프로젝트에 추가하기 (Add to existing project)
이미 Meteor 프로젝트가 있다면 초기화 CLI로 Flowbite React를 추가할 수 있어요. 이 명령은 Flowbite React를 설치하고 Flowbite 플러그인으로 Tailwind를 설정합니다.
npx flowbite-react@latest init
맞춤 설치 (Custom installation)
모든 것을 수동으로 설정하거나 설정을 더 세밀하게 제어하려면 다음 단계들을 따르세요. 프로젝트 생성, Tailwind CSS 설치(postcss 설정 포함), Flowbite React 설치 순서로 진행됩니다.
meteor create meteor-project
cd meteor-project
meteor create meteor-project --typescript
cd meteor-project
npm install -D tailwindcss @tailwindcss/postcss postcss postcss-load-config
touch postcss.config.mjs
/** @type {import('postcss-load-config').Config} */
const config = {
plugins: {
'@tailwindcss/postcss': {},
},
};
export default config;
@import 'tailwindcss';
npx flowbite-react@latest init
React 컴포넌트 (React components)
Flowbite React, Meteor.js, Tailwind CSS 설치가 끝나면 버튼, 드롭다운, 모달, 내비게이션 바 등의 컴포넌트를 사용할 수 있어요. 자세한 컴포넌트 사용법은 공식 문서를 참고하세요.
// imports/ui/App.tsx (or .jsx)
import { Button } from 'flowbite-react';
import React from 'react';
export const App = () => (
<>
<Button>Click me</Button>
</>
);
테마 커스터마이즈 (Theme customization)
Flowbite React는 새 테마 엔진을 이용한 고급 커스터마이즈 시스템을 제공합니다. 컴포넌트의 className 속성으로 직접 스타일을 지정할 수도 있고, 컴포넌트에 theme 객체를 전달해 스타일을 구성할 수 있어요. createTheme 헬퍼로 테마 객체를 만들면 서브컴포넌트까지 스타일링할 수 있습니다.
import { Button } from "flowbite-react";
function App() {
return <Button className="bg-red-500 hover:bg-red-600">Custom Button</Button>;
}
import { Button, createTheme, ThemeProvider } from "flowbite-react";
const customTheme = createTheme({
button: {
color: {
primary: "bg-red-500 hover:bg-red-600",
secondary: "bg-blue-500 hover:bg-blue-600",
},
size: {
lg: "px-6 py-3 text-lg",
},
},
});
function App() {
return (
<ThemeProvider theme={customTheme}>
<Button color="primary">Red Button</Button>
<Button color="secondary" size="lg">
Large Blue Button
</Button>
</ThemeProvider>
);
}
오픈소스 커뮤니티 (Open-source community)
Flowbite React UI 라이브러리는 MIT 라이선스의 무료 오픈소스 프로젝트예요. GitHub에서 소스 코드를 확인하고 개발자 커뮤니티와 함께 기여할 수 있습니다.
개발 지원 (Support development)
오픈소스 작업을 지원하고 싶다면 400개 이상의 컴포넌트·템플릿, Figma 디자인 시스템, 관리자 대시보드 등을 포함한 Flowbite 프로 버전을 살펴보세요.