Skip to content

はじめに ​

thl-ui は独自の CSS(Bootstrap も jQuery も不要)を持つフレームワーク非依存のデザインシステムで、React・Vue・Angular 向けのネイティブコンポーネントを提供します。

アーキテクチャ ​

            ┌────────────────────────── @thl-ui/core ──────────────────────────┐
            │  createThl()  →  config store · i18n · applyToDocument()          │
            │  headless: tabs · table · select · toast · upload · calendar …    │
            │  utils: bem() · cx() · focusTrap · scrollLock · clickOutside      │
            └───────────────▲──────────────────▲──────────────────▲────────────┘
                            │                  │                  │
   @thl-ui/tokens ──► @thl-ui/styles (CSS vars, .thl-* BEM, 12 skins, dark)
                            │                  │                  │
                  @thl-ui/react         @thl-ui/vue        @thl-ui/angular
               ThlProvider + hooks   plugin + composables  provideThlUI + signals
パッケージ用途
@thl-ui/tokensデザイントークン(パレット、余白、角丸、スキン)→ CSS カスタムプロパティ
@thl-ui/stylesフレームワーク非依存の CSS(thl-ui.css、コンポーネント別 CSS、SCSS ソース)
@thl-ui/localesen、vi、ja、zh のメッセージと型
@thl-ui/core設定、i18n、ヘッドレスなステートマシン、ユーティリティ
@thl-ui/iconsアイコンレジストリ(lucide のサブセット、フォントアイコンで拡張可能)
@thl-ui/charts依存関係のない SVG チャートのジオメトリ
@thl-ui/react · @thl-ui/vue · @thl-ui/angularネイティブアダプター

同じ API を 3 つのフレームワークで ​

どのアダプターも同一のマークアップ(共通の bem() ヘルパーで生成)を出力し、同じ prop 名を公開しているため、コンポーネントはどこでも同じ見た目と動作になります。

vue
<ThlButton variant="primary" icon="download" rounded>ダウンロード</ThlButton>
tsx
<Button variant="primary" icon="download" rounded>ダウンロード</Button>
html
<button thl-button variant="primary" icon="download" rounded>ダウンロード</button>

違いは各フレームワークの慣習に従う部分だけです。

概念VueReactAngular
インストールapp.use(ThlUI, config)<ThlProvider config>provideThlUI(config)
双方向バインディングv-modelvalue + onChange[(value)], formControlName, ngModel
翻訳useI18n().t / $tuseT()ThlI18nService.t / | thlT
設定useThlConfig()useThlConfig()ThlConfigService
トーストuseToast()useToast()ThlToastService
確認ダイアログconfirm()confirm()ThlModalService.confirm()
コンポーネント名ThlButtonButtonThlButtonComponent / thl-* セレクター

次のステップ ​