Tools / Component Generator

Component Generator

Pick a component - button, card, alert, badge or navbar - set the label and tone, and copy production-ready HTML+CSS.

Pick a component and tune it; the preview and code update live.

Component

Preview

Code

Kit

Nothing in the kit yet. Add components, then download them as one page.

What it does

The snippet, with the styling attached.

Five primitives

Button, card, alert, badge and navbar cover most page scaffolding.

Tone and size

Accent color and sm/md/lg sizing apply to both preview and code.

One scoped class

Styles live behind a generated class prefix, so the snippet cannot leak into your page.

Preview is the code

The preview renders the exact markup and CSS you copy.

Contrast checked for you

The text colour is not a guess: the tool measures the contrast ratio of black and of white against your accent and picks whichever reads better.

An accent that stays readable

If your accent is too dark against the surface, the tool lightens it in small steps - up to 20 - until it clears a 7:1 contrast ratio, and adds a border when the ratio sits under 3:1.

Three sizes, real numbers

Small, medium and large set padding and type together: 12px, 14px or 17px type with padding pairs to match, so a large button actually feels large.

An alert that announces itself

The alert markup carries role="alert", so screen readers speak it when it appears, with a 3px accent edge marking it out from body text.

A navbar with working parts

Brand on the left, three links on the right, an accent hover on each link, and spacing that follows the size you picked.

No class collisions

Every rule is scoped under the genx- prefix, so the snippet drops into an existing stylesheet without renaming anything or leaking into your other components.

Copy and go

One button copies the HTML and the style block together. There is nothing to install, nothing to sign into and nothing to configure.

How it works

Pick, tune, copy.

Step 1

Choose the component type.

Step 2

Set the label, tone and size.

Step 3

Copy the HTML+CSS into your project.

FAQ

Framework version?

The output is framework-free HTML+CSS; wrap it in your component of choice.

Dark and light?

The palette is dark-first; the CSS variables at the top make it one edit to flip.

Which components are included?

Button, card, alert, badge and navbar. Each one takes your label, your accent colour and one of the three sizes.

What does the size control change?

Padding and font size together. Small is 12px type, medium is 14px and large is 17px, with padding scaled to keep the proportions.

Why did my accent colour shift?

The tool measured its contrast against the dark surface and lightened it until the ratio reached 7:1. The shifted value is what lands in the copied CSS.

Can I paste the code as-is?

Yes. The HTML goes where the component belongs and the style block goes into your stylesheet. The genx- classes are self-contained.

Does the preview match the code?

Exactly. The preview is rendered from the same CSS the copy button hands you, so what you see is what ships.

Worked example

Real output, from the tool itself.

This is what Component Generator returned for the example input shown, captured from the tool itself - not a mockup.

You enter

Component type

button

Label

Start hiring free

Size

md

The tool returns

<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>

Component Generator

See it at work

Pick a component - button, card, alert, badge or navbar - set the label and tone, and copy production-ready HTML+CSS.

Component Generator
Fields
API
CLI
spec
framework
hiringsai tool component-generator
spec string
framework vanilla
2 fields, 1 required
curl -X POST https://hiringsai.com/api/v1/tools/component-generator/run
-d '{"input": {"spec": "<text>"}}'
JSON result
hiringsai run component-generator --input '{"spec": "<text>"}'
also callable over MCP
JSON result printed
Free toolAPI and MCPNo account
Fields
specstring
frameworkvanilla
Ways to use it
pagethis app
APIPOST .../run
CLIhiringsai run
MCPtools/call
API call
POST /api/v1/tools/component-generator/run
input: {"spec": "<text>"}
JSON result back
Command line
hiringsai run component-generator
--input <json>
JSON result printed
The Component Generator page as it opens
Component Generator2 fields
The page as it opens, captured from the live site.
The Component Generator app at phone width
Component Generatorphone layout
The same app at phone width.
A desk seen from above with a laptop, headphones and a camera
Component GeneratorFree tool
Pick a component - button, card, alert, badge or navbar - set the label and tone, and copy production-ready HTML+CSS.
A team working around a table with laptops
Component GeneratorAPI and MCP
Call it from a script over the API or MCP.