Components

Button

Interactive button component with multiple variants, sizes, and states for various user actions in government applications.

Basic Usage

The default button with primary variant and medium size for main actions.

Variants

Different button styles for various use cases. Use primary for main actions, secondary for less important actions, outline for subtle actions, ghost for minimal styling, danger for destructive actions, and link for text-based navigation.

Sizes

Four different sizes to match your interface needs. Small for compact spaces, medium for general use, large for prominent actions, and extra large for hero sections.

States

Loading and disabled states provide feedback during async operations and prevent user interaction when necessary.

With Icons

Buttons can include icons to provide visual context. Icons can be positioned on the left or right side of the text.

Government Application Example

A real-world example showing buttons in a government application context with bilingual support.

Trade License Application / ট্রেড লাইসেন্স আবেদন

Use Cases

Primary Actions

Submit forms, create applications, confirm payments, save data

Secondary Actions

Cancel operations, view details, print documents, reset forms

Destructive Actions

Delete applications, cancel appointments, remove documents

Navigation Actions

Navigate between steps, go to external links, open modals

Best Practices

Button Hierarchy

  • • Use only one primary button per page or section
  • • Place primary button on the right for form actions
  • • Use secondary buttons for alternative actions
  • • Group related buttons together with consistent spacing

Accessibility & Internationalization

  • • Provide bilingual text (English/Bengali) for government services
  • • Ensure sufficient color contrast for all variants
  • • Include proper focus indicators for keyboard navigation
  • • Use clear, action-oriented labels that describe the outcome

User Experience

  • • Show loading states for operations taking more than 1 second
  • • Provide immediate feedback after button clicks
  • • Use icons consistently to reinforce button meaning
  • • Implement proper error handling and retry mechanisms

Usage Guidelines

Do

  • Use primary buttons for the main action on a page
  • Provide clear, action-oriented labels
  • Use loading states for async operations
  • Include icons when they add clarity
  • Use consistent button sizes within a group
  • Support both Bengali and English text

Don't

  • Use multiple primary buttons on the same page
  • Make button text too long or vague
  • Use disabled state without explanation
  • Mix different button sizes randomly
  • Use danger variant for non-destructive actions
  • Forget to handle loading and error states

Component Specifications

Detailed specifications and characteristics of the Button component for implementation guidance.

SpecificationDetailsPurpose & Usage
Component TypeInteractive ElementTriggers actions and navigates users through workflows
Complexity LevelLowSimple to implement and customize, suitable for basic UI needs
Variant OptionsPrimary, Secondary, Outline, Ghost, Danger, LinkMultiple styles to establish visual hierarchy and context
Size OptionsSmall, Medium, Large, Extra LargeAdapts to different interface contexts and importance levels
State ManagementDefault, Hover, Focus, Loading, DisabledProvides clear feedback for user interactions and system states
Icon SupportLeft/Right positioning, OptionalEnhances meaning and improves visual recognition
Accessibility FeaturesKeyboard navigation, Focus indicators, Screen reader supportEnsures usability for all citizens including those with disabilities
Language SupportEnglish, Bengali (বাংলা)Bilingual text support for government applications
Design SystemColor tokens, Typography scale, Spacing unitsConsistent with CivixUI design principles and government branding
Use CasesForm submission, Navigation, Actions, DownloadsPrimary interface element for user-initiated actions in government services

Accessibility

  • • All buttons support keyboard navigation (Tab, Enter, Space)
  • • Focus states are clearly visible with ring indicators
  • • Loading states announce changes to screen readers
  • • Disabled buttons are properly marked for assistive technology
  • • Color contrast meets WCAG 2.1 AA standards
  • • Icons include appropriate aria-labels when needed