A laptop, a phone and a hand writing in a notebook on a wooden desk, banner image on the Component Generator page

ツール/ Buildスイート

Component Generator

コンポーネント(ボタン、カード、アラート、バッジ、ナビバー)を選び、ラベルとトーンを決めて、本番で使えるHTML+CSSをコピーします。

コンポーネントを選び、ラベル、トーン、サイズを決めると、HTMLとCSSがライブプレビューつきで一緒に手に入ります。ボタンやカード1つに20分もCSSの発掘作業をする必要はありません。

ツールを開く
Screenshot of the Component Generator tool

できること

スタイル付きのスニペット。

5つの基本パーツ

ボタン、カード、アラート、バッジ、ナビバーで、ページの骨組みのほとんどをカバーできます。

トーンとサイズ

アクセントカラーとsm/md/lgのサイズは、プレビューとコードの両方に反映されます。

スコープ付きの1つのクラス

スタイルは生成されたクラスプレフィックスの内側にあるため、スニペットがページに影響することはありません。

プレビューがそのままコード

プレビューは、コピーするマークアップとCSSそのものを描画します。

コントラストは自動でチェック

文字色は推測ではありません。ツールは黒と白それぞれのアクセントに対するコントラスト比を測り、読みやすい方を選びます。

読みやすさを保つアクセント

アクセントカラーが背景に対して暗すぎる場合、ツールはコントラスト比7:1を超えるまで少しずつ(最大20段階)明るくし、比率が3:1を下回る場合は縁を追加します。

3つのサイズ、実際の数値

小・中・大はパディングと文字を一緒に決めます。12px、14px、17pxの文字にそれぞれ合うパディングが付くので、大きなボタンは本当に大きく感じられます。

自分で読み上げられるアラート

アラートのマークアップには role="alert" が付いているため、表示されたときにスクリーンリーダーが読み上げます。3pxのアクセントの縁が本文との区別になります。

動くパーツを備えたナビバー

左にブランド、右に3つのリンク、各リンクにアクセント色のホバー、選んだサイズに合わせた余白。

クラス名の衝突なし

すべてのルールは genx- プレフィックスの下に収められているため、何も名前を変えずに既存のスタイルシートへ入れられ、他のコンポーネントに影響しません。

コピーしてすぐ使う

ボタン1つでHTMLとスタイルブロックをまとめてコピーできます。インストールもログインも設定も不要です。

使い方の流れ

選んで、整えて、コピー。

手順1

コンポーネントの種類を選びます。

手順2

ラベル、トーン、サイズを設定します。

手順3

HTML+CSSをプロジェクトにコピーします。

よくある質問

フレームワーク版は?

出力はフレームワークに依存しないHTML+CSSです。お好みのコンポーネントで包んでください。

ダークとライトは?

配色はダーク優先です。先頭のCSS変数を1か所編集するだけで切り替えられます。

どのコンポーネントが含まれますか?

ボタン、カード、アラート、バッジ、ナビバー。どれもラベル、アクセントカラー、3つのサイズのいずれかを受け付けます。

サイズの設定で何が変わりますか?

パディングとフォントサイズをセットで調整します。小は12px、中は14px、大は17pxの文字で、パディングも比率を保つよう拡大されます。

アクセントカラーが変わったのはなぜですか?

ツールは暗い背景に対するコントラストを測り、比率が7:1に達するまで明るくしました。変更後の値がコピーされるCSSに入ります。

コードはそのまま貼り付けられますか?

はい。HTMLはコンポーネントを置く場所に、スタイルブロックはスタイルシートに入れます。genx- のクラスは単体で完結しています。

プレビューはコードと一致しますか?

そのとおりです。プレビューはコピーボタンが渡すものと同じCSSで描画されるので、見たままが手に入ります。

Component Generatorを開く

実例

ツールそのものからの実際の出力。

これはComponent Generatorが示した入力例に対して返したもので、ツール自体からキャプチャーした実際の出力です。モックアップではありません。

あなたが入力

コンポーネントの種類

button

ラベル

Start hiring free

サイズ

md

ツールが返す

<button class="genx-btn">Start hiring free</button>

<style>
.genx-btn{background:#bdbdbd;color:#0b0b0b;border:none;border-radius:999px;padding:11px 22px;font:600 14px system-ui,sans-serif;cursor:pointer}.genx-btn:hover{filter:brightness(1.08)}
</style>
自分の入力で試す

Buildスイートのその他のツール

Font Pairing LabWebhook TesterPricing Page BuilderLanding Page MakerStatus Page Starter
A laptop, headphones, a camera, a phone and a plant on a white desk, seen from above, banner image on the Component Generator page

今すぐ試す。

Component Generatorはブラウザー内で動きます。アカウントは不要です。

入力から出力へ

選んで、ラベルを付けて、コピー

Type, label,accent color,sizeLive previewHTML and CSScodeCopy codeComponentGeneratorInOut
InType, label, accent color, sizeComponentGeneratorLive previewHTML and CSS codeCopy codeOut
いくつか選ぶだけで、貼り付けられるHTMLとCSSができます。

仕様シート

5種類のコンポーネント

buttonpill with hover brighteningcardtag, title, body, linkalertleft accent bar, role alertbadgeoutline pillnavbarbrand plus three links
buttonpill with hover brighteningcardtag, title, body, linkalertleft accent bar, role alertbadgeoutline pillnavbarbrand plus three links
それぞれが提供するもの。

ビフォー アフター

サイズ別のパディング

サイズPaddingSmallMediumLarge7px 14px11px 22px15px 30px
Size to PaddingSmall7px 14pxMedium11px 22pxLarge15px 30px
サイズごとにパディングが決まります。

ビフォー アフター

サイズ別の文字サイズ

サイズFont sizeSmallMediumLarge12px14px17px
Size to Font sizeSmall12pxMedium14pxLarge17px
サイズごとにフォントサイズが決まります。

パイプライン

コードの作られ方

Read type, label,color, sizePick padding andfont sizeWork out textcolorsWrite the HTMLWrite the CSS
Read type, label, color, sizePick padding and font sizeWork out text colorsWrite the HTMLWrite the CSS
どの種類でも同じ手順です。

パイプライン

ボタンの文字色の選び方

Measure near blackon the accentMeasure white onthe accentPick the higherratioUse it as the textcolor
Measure near black on the accentMeasure white on the accentPick the higher ratioUse it as the text color
ボタンは2つの文字色のうち読みやすい方を選びます。

ビフォー アフター

アクセント別の文字色

AccentText colorA light gray accentA deep blue accentNear black textWhite text
Accent to Text colorA light gray accentNear black textA deep blue accentWhite text
明るいアクセントには暗い文字、暗いアクセントには明るい文字が付きます。

仕様シート

ボタンの縁のフォールバック

Measureaccent against near blackUnder 3:1a 1px light border is addedOtherwiseno border
Measureaccent against near blackUnder 3:1a 1px light border is addedOtherwiseno border
コントラストの低いアクセントには縁が付きます。

パイプライン

アクセントの文字を読みやすくする

Start with youraccentCheck contrast onthe cardbackgroundBelow 7:1: mix ina little whiteRepeat up to 20timesUse the first onethat passes
Start with your accentCheck contrast on the cardbackgroundBelow 7:1: mix in a little whiteRepeat up to 20 timesUse the first one that passes
暗い背景では、はっきり読めるまでアクセントが明るくされます。

仕様シート

コントラストの目標

Target7:1 on the dark backgroundReached bylightening in 5% stepsGives up after20 steps
Target7:1 on the dark backgroundReached bylightening in 5% stepsGives up after20 steps
アクセントカラーの文字用。

仕様シート

クラス名

Prefixgenx-Examplesgenx-btn, genx-cardScopeone class per component part
Prefixgenx-Examplesgenx-btn, genx-cardScopeone class per component part
予測しやすく、衝突もありません。

ビフォー アフター

アクセントカラーが色を付ける場所

TypeAccent used forButtonCardAlertBadgeNavbarBackgroundTag and link textLeft stripeOutline and textLink hover
Type to Accent used forButtonBackgroundCardTag and link textAlertLeft stripeBadgeOutline and textNavbarLink hover
種類ごとに、アクセントを使う場所が異なります。

入力から出力へ

プレビューとコード

Your choicesLive previewon the rightHTML plus astyle blockComponentGeneratorInOut
InYour choicesComponentGeneratorLive preview on the rightHTML plus a style blockOut
どちらも同じ生成結果から出てきます。

仕様シート

コードボックス

Containsthe markup, then a styleblockSelf-containedno external filesCopyone click
Containsthe markup, then a style blockSelf-containedno external filesCopyone click
そのまま貼り付けられます。

パイプライン

コードの使い方

Pick and labelCheck the previewClick Copy codePaste into yourpageRename the classesif you like
Pick and labelCheck the previewClick Copy codePaste into your pageRename the classes if you like
貼り付けてすぐ使えます。

パイプライン

変更するとすぐ反映

Type, label, coloror sizeMarkup and CSSregenerateThe previewre-rendersCopy grabs thelatest
Type, label, color or sizeMarkup and CSS regenerateThe preview re-rendersCopy grabs the latest
生成ボタンはありません。

仕様シート

初期値

TypebuttonラベルDeploy to production色#bdbdbdサイズsmall
TypebuttonラベルDeploy to production色#bdbdbdサイズsmall
開いたときに表示されるもの。

パイプライン

すべてローカルで動きます

No libraries orframeworksNo network callsanywhereCopy is the onlyexport
No libraries or frameworksNo network calls anywhereCopy is the only export
ページの外には何も出ません。