<button>
The <button>
component represents an interactive button used to trigger actions or submit forms. It supports variant styling, size options, and optional icons through a complete structural definition approach.
🛠Attributes
type
string
No
button
, submit
, or reset
variant
string
No
Visual style variant
size
string
No
Size variant
state
string
No
Current state
style
string
No
Additional style overrides
ai-hint
string
No
Context for AI interpretation
Component Definition
💡 Examples
Basic Usage
Primary Button with Icon
Disabled Secondary Button
Ghost Button with Custom Style
🧩 AI Interpretation Guidelines
Component Rendering
Start with the base structure
Apply size variations if specified
Apply style variations if specified
Apply state variations if specified
Apply any custom style overrides
Apply AI hints for context
State Management
Handle hover/focus states automatically
Apply disabled state when specified
Maintain proper focus management
Ensure keyboard accessibility
Support screen readers
Best Practices
Use semantic HTML (
<button>
element)Include proper ARIA attributes
Maintain consistent spacing
Ensure sufficient contrast
Support keyboard navigation
Last updated