MeDo

Gerador de Botões com IA.

Descreva sua marca e o MeDo gera todo o sistema de botões — variantes primary, secondary, ghost e destructive, três tamanhos, além dos estados hover, foco, loading e desabilitado. Um prompt, um conjunto consistente.

Button
Button

Botões representam cerca de um quarto de qualquer design system

Nenhum componente é usado com mais frequência. Todo envio de formulário, todo CTA, todo diálogo de confirmação passa por um botão — e é exatamente por isso que a inconsistência aqui fica tão visível. Dez botões ligeiramente diferentes em um produto passam a impressão de desleixo muito antes de alguém conseguir explicar o motivo. Gerar o conjunto inteiro de uma vez, a partir de uma única descrição, faz com que as variantes compartilhem escala de espaçamento, raio e tratamento de foco por construção, e não por disciplina.

6 modelos

Modelos de Button que você pode gerar

Cada modelo é um prompt real, não uma captura de tela. Copie para qualquer editor de IA, ou rode no MeDo e receba código React + Tailwind.

BasicVariant Set

Four Roles, Three Sizes

The set you generate first and edit for a year. Roles rather than colors, so a rebrand moves one token instead of forty class strings.

Create a reusable button component with four role-based variants: primary as a solid brand fill with white text, secondary as a white surface with a grey border, ghost as transparent with a tinted background on hover, and destructive as a solid red. Support sm at 32px tall, md at 40px and lg at 48px, plus a fullWidth prop. Wire hover, active, focus-visible, disabled and loading states for every variant, keeping the focus ring on focus-visible only so mouse clicks do not draw it. Render a real button element with an explicit type attribute, and drive all four variants from one shared spacing and radius scale rather than per-variant values.

Teste no MeDo
IconsIcon + Label

Leading and Trailing Icon Slots

Two slots, one gap token. Most icon bugs are spacing bugs — an icon glued to its label, or optically misaligned because the SVG box is taller than the cap height.

Extend a button component with optional leading and trailing icon slots. Size the icon to 16px at sm and md and 18px at lg, set a consistent 8px gap between icon and label, and add aria-hidden="true" to the icon so screen readers announce the label only. Flip the slot order automatically under a right-to-left direction. Use inline-flex with items-center so the icon aligns to the label cap height rather than the line box, and give the SVG shrink-0 so a long wrapping label cannot squash it. Accept any React node so a spinner or an avatar can occupy the same slot.

Teste no MeDo
LoadingAsync Submit

Loading Button With a Locked Width

A submit button that shrinks when the spinner replaces the label makes the whole form jump. Reserve the width and the click feels instant instead of broken.

Create a submit button with a loading prop. While loading, replace the label with a centered spinner but keep the button at its resting width by rendering the label at zero opacity underneath the spinner rather than removing it from the DOM. Set aria-busy="true" and aria-disabled="true", block repeat submissions, and keep the button focusable so a screen reader can still read the pending state. Respect prefers-reduced-motion by swapping the rotating spinner for a static pulsing dot. Add an optional loadingText prop that announces progress through a polite live region instead of changing the visible label.

Teste no MeDo
ToolbarIcon Only

Square Icon Button With a Tooltip

Dense toolbars need it, and it fails accessibility more often than any other button. No visible text means the accessible name has to come from somewhere explicit.

Create an icon-only button for a dense toolbar: a square target at 32px, 36px and 40px with the icon centered and no label. Require an ariaLabel prop and render it as aria-label on the button, since there is no visible text to name the control. Expand the hit area to at least 44px with a negative-margin pseudo-element so touch targets meet the minimum without widening the toolbar. Pair it with a tooltip that appears on hover and on keyboard focus, referenced with aria-describedby so the tooltip supplements the label rather than replacing it. Include a pressed state driven by aria-pressed for toggle uses.

Teste no MeDo
GroupSplit Action

Split Button With a Menu Half

One default action plus a menu of alternates — Save and Save as, Deploy and Deploy to staging. Two buttons that must look like one and stay independently reachable.

Create a split button: a primary action on the left and a narrow chevron trigger on the right, joined into one visual unit with a 1px divider, the outer corners rounded and the inner corners square. Render them as two separate button elements so each keeps its own accessible name, giving the chevron a label such as "More save options". Wire the chevron to a menu with aria-haspopup="menu" and aria-expanded, opening on click and on ArrowDown, closing on Escape with focus returned to the trigger. Keep the focus ring visible on each half by drawing it outside the shared border rather than inside it.

Teste no MeDo
PolymorphicLink as Button

Anchor With Button Styling

A styled div with an onClick is not a button and a button that navigates is not a link. One asChild prop keeps the styling while the correct element still ships.

Create a polymorphic button that accepts an asChild prop and forwards its variant, size and state classes onto a child element, so a Next.js Link or a plain anchor can carry button styling without nesting an interactive element inside a button. Forward the ref, merge className rather than overwriting it, and skip the type attribute when the rendered element is not a button. When the target is an anchor, omit the disabled attribute — which anchors ignore — and instead drop href and set aria-disabled with pointer-events none. Add an external variant that appends rel="noopener noreferrer" and a visually hidden "opens in a new tab" note.

Teste no MeDo

Como personalizar seu Button

Defina as variantes, não apenas as cores

Peça variantes por função — primary, secondary, ghost, destructive — em vez de por cor. Nomes baseados em função sobrevivem a um rebranding: quando a cor da marca muda, "primary" continua significando a mesma coisa e apenas um token precisa ser ajustado.

Especifique o estado de loading explicitamente

Diga que o spinner deve substituir o rótulo preservando a largura do botão. Caso contrário, os botões encolhem no meio do envio e o layout ao redor salta — um dos defeitos de acabamento mais comuns em UI gerada.

Peça focus-visible, não focus

Um anel em :focus também aparece em cliques de mouse e parece um bug. Peça :focus-visible para que o anel apareça apenas para usuários de teclado e tecnologia assistiva, que é o que as auditorias de acessibilidade realmente verificam.

Defina a semântica do disabled

Decida se botões desabilitados devem usar o atributo disabled ou aria-disabled. O atributo bloqueia todos os eventos, inclusive o foco; aria-disabled mantém o botão focalizável para que leitores de tela ainda possam anunciar por que ele está indisponível. Diga qual você quer.

Quem usa o componente Button

Produto SaaS

Um botão primary para o CTA do trial, secondary para "Agendar uma demo", ghost para links terciários dentro de cards e destructive para exclusão de conta — todos com o mesmo raio e anel de foco, para que a interface se leia como um único produto.

Loja de e-commerce

Um botão "Adicionar ao carrinho" de alto contraste com estado de loading durante a checagem de estoque, mais uma variante secondary mais discreta de "Salvar para depois" que não disputa atenção com ele.

Dashboard ou ferramenta de admin

Toolbars densas precisam de botões pequenos, apenas com ícone e rótulos acessíveis, ao lado de botões de ação em tamanho padrão. Uma escala de sm a lg mantém a toolbar compacta sem inventar estilos pontuais.

Landing page de marketing

Um único botão primary superdimensionado acima da dobra, repetido no fim da página, com uma variante ghost para o link secundário "Veja como funciona" que rola a página em vez de converter.

Padrões de Button para diferentes sites

O mesmo componente button, ajustado ao tipo de site em que ele entra.

01 / 06

SaaS Product Buttons

One primary per screen is the rule that keeps a product feeling directed. Everything else drops to secondary or ghost, and destructive stays reserved for irreversible actions so a red button always means the same thing. The moment two primaries appear in one view, users start reading the layout instead of acting on it.

Estilos e variações de Button

Escolha a variação que combina com o resto da página e gere-a.

01 / 06

Solid Button

A filled surface with white or near-white text, carrying the highest visual weight on the page. Check the contrast against the fill rather than the page background, and remember that a lightened hover state can quietly drop a passing 4.5:1 pairing below the line.

Button em React, Next.js, Vue e Svelte

React, Next.js, Vue 3, SvelteKit, Astro ou HTML puro — o mesmo button, seis formas de integrar.

01 / 06

React Button

Derive the class string from variant and size lookups instead of chained ternaries, and forward the ref so tooltips and popovers can anchor to the element. Spread the remaining props last so a caller can still pass type or aria attributes through.

src/components/Button.tsx

export const Button = forwardRef(function Button(
  { variant = 'primary', size = 'md', loading, ...props },
  ref
) {
  return (
    <button
      ref={ref}
      type="button"
      aria-busy={loading}
      className={cn(base, variants[variant], sizes[size])}
      {...props}
    />
  )
})

Como adicionar o seu Button a um projeto

Quatro passos, de escolher um modelo de button até subir para produção.

01~30s

Pick a Button Template

Scan the six templates and start from the closest surface — the full variant set for a design system, the async submit for a form, the icon-only for a toolbar.

02~10s

Copy the Prompt

Take the prompt into MeDo, Lovable, Bolt, v0 or Cursor. Swap in your brand color, radius and font before you run it, since those three values are what every variant inherits.

03~1min

Generate and Refine

You get React + Tailwind back with a live preview. Follow up in plain English — "add an xs size", "make the disabled state use aria-disabled" — rather than hand-editing the class lookups.

04~2min

Replace Your Ad-Hoc Buttons

Import one Button and delete the one-off styles it supersedes. The value is in the variants sharing a spacing scale and focus ring by construction, which only holds if nothing else on the page is styling its own button.

Perguntas comuns sobre Button

Como gerar um componente de botão com IA?

Descreva as variantes, tamanhos e estados necessários em um só prompt — por exemplo "variantes primary, secondary e ghost em três tamanhos com estados hover, disabled e loading" — e o MeDo gera o componente completo com todas as combinações conectadas. Você recebe um arquivo cobrindo o conjunto inteiro, não um botão fixo.

Quais variantes de botão um design system deve ter?

A maioria dos produtos precisa de quatro: primary para a ação mais importante da tela, secondary para ações de apoio, ghost ou terciária para ações de baixa ênfase em interfaces densas e destructive para qualquer coisa irreversível. Mais variantes do que isso costuma indicar um problema de hierarquia, não um estilo faltando.

A IA consegue gerar botões acessíveis?

Sim. O MeDo renderiza elementos button reais com atributo type explícito, anéis focus-visible, nomes acessíveis para botões apenas com ícone e estados desabilitados que os leitores de tela anunciam corretamente. Mencione acessibilidade no prompt e ele também adiciona aria-busy durante o loading.

Como adicionar um estado de loading a um botão?

Peça uma prop loading que troque o rótulo por um spinner mantendo a largura do botão fixa, desabilite a interação e defina aria-busy para que a tecnologia assistiva anuncie o estado pendente. Fixar a largura é a parte que as pessoas esquecem — sem isso a página se reorganiza a cada clique.

Um botão deve ser um button ou um link?

Se navega, deve ser um anchor; se executa uma ação, deve ser um button. Diga ao MeDo qual comportamento você quer e ele renderiza o elemento correto, com uma saída no estilo asChild quando você precisar da estilização de botão em um link de rota.

Posso gerar botões que combinem com minha marca atual?

Sim. Informe no prompt a cor da marca, o raio das bordas, a fonte e qualquer escala de espaçamento existente, e as variantes geradas vão usá-las de forma consistente. Você também pode colar um botão já existente do seu código e pedir ao MeDo para expandi-lo em um conjunto completo de variantes.