Skip to content
Logic2BUI

Search docs

Search components and documentation

New
Menu

Button

Displays a button or a component that looks like a button.

Installation

npx logic2b@next add button

Usage

import { Button } from "@/components/ui/button"

<Button variant="outline" size="lg">Click me</Button>

Usage notes

<Button asChild>
  <a href="/docs">Read the docs</a>
</Button>

Live playground

Edit the component props and inspect the exact JSX before copying it. The preview loads only when this section enters the viewport.

Generated JSX
<Button
  variant="default"
  size="default"
>Continue</Button>

API reference

Generated from the public TypeScript exports in src/ui/button.tsx.

View JSON

Button

Component
Props: React.ComponentProps<"button"> & VariantProps<typeof buttonVariants> & { asChild?: boolean }
PropTypeRequiredDefaultDescription
variantnull | "link" | "default" | "destructive" | "secondary" | "outline" | "ghost"No——
sizenull | "default" | "sm" | "lg" | "icon"No——
asChildbooleanNofalse—

buttonVariants

Utility
(props?: (ConfigVariants<{ variant: { default: string; destructive: string; outline: string; secondary: string; ghost: string; link: string; }; size: { default: string; sm: string; lg: string; icon: string; }; }> & ClassProp) | undefined): string

Accessibility contract

Machine-readable behavior and consumer responsibilities for button.

View JSON
Support
Native semantics
Pattern
button
HTMLButtonElement
Keyboard interactions for button
KeysBehavior
Enter SpaceActivate the focused control.

Built-in semantics

  • Uses native button semantics unless asChild changes the rendered element.

Consumer responsibilities

  • Keep a visible label or provide aria-label for icon-only actions.