Skip to content

codeyousef/summon

Repository files navigation

Summon

Summon is a powerful, type-safe frontend framework for Kotlin Multiplatform that brings the elegance of Jetpack Compose to both browser and JVM environments. Build beautiful, responsive applications with a declarative syntax that feels natural to Kotlin developers.

🎨 Type-safe styling with an intuitive modifier API inspired by Compose.

🧩 Component-based architecture for maximum reusability and maintainability.

🔄 Reactive state management that automatically updates your UI when data changes.

Summon combines the best ideas from modern frontend frameworks like React, Vue, and Next.js with the declarative UI patterns of Jetpack Compose and SwiftUI, while leveraging Kotlin's powerful type system to catch errors at compile time rather than runtime. Whether you're building a simple website or a complex web application, Summon provides the tools you need to create polished, professional user interfaces with less code and fewer bugs.

Features

  • Cross-Platform: Build once, run on both JavaScript and JVM platforms
  • Component-Based: Create reusable UI components with a declarative syntax
  • Type-Safe: Leverage Kotlin's type system for safer UI development with compile-time checks
  • Enhanced Styling System:
    • Flexible and powerful styling using a comprehensive modifier API
    • Type-safe CSS properties with enum support for values like BorderStyle, Alignment, etc.
    • Numeric extensions for CSS units (px, rem, em, etc.) for cleaner code
    • Comprehensive gradient support with both linear and radial options
    • Extensive color system with Material Design and Catppuccin palettes
  • Flexible Layout System:
    • Powerful flexbox layout with alignment controls
    • Row and Column components with intuitive alignment modifiers
    • Grid layout support with comprehensive controls
  • State Management: Simple yet powerful reactive state management solutions
  • Next.js-Style Routing: File-based routing with automatic page discovery and code generation
  • Lifecycle Aware: Built-in lifecycle management with side effects and cleanup
  • Framework Interoperability: Integrate with existing frameworks like Quarkus, Ktor, and Spring Boot
  • Security: Comprehensive JWT authentication and role-based access control (RBAC)
  • Accessibility: Built-in accessibility features with ARIA support for inclusive applications
  • Animation and Transitions:
    • Smooth animations with keyframes support
    • CSS transitions with type-safe timing functions and properties
    • Transform operations for scaling, rotation, and translation
  • SSR Support: Server-side rendering capabilities for improved performance
  • Enhanced Theme System:
    • Flexible theming with dark mode support
    • Type-safe theme properties for typography, spacing, colors, and more
    • Easy theme switching at runtime
  • Internationalization: Full i18n support with RTL layouts for languages like Arabic and Hebrew

What's New

Recent enhancements to Summon include:

  • Enhanced Theme System with typed theme classes for more type-safe access
  • Improved Modifier API with type-safe CSS properties and enum support
  • Comprehensive Border API with support for individual sides and properties
  • Enhanced Flexbox Layout with alignment controls for Row and Column components
  • Extensive Color System with Material Design and Catppuccin palettes
  • Gradient Support for both linear and radial gradients with flexible options
  • Animation Enhancements with keyframes and transition support
  • Improved Documentation with comprehensive examples and API references

Component Categories

Summon provides a comprehensive set of UI components organized into logical categories:

Input Components

  • TextField - Single-line text input
  • TextArea - Multi-line text input
  • Button - Clickable button with various styles
  • Checkbox - Checkbox input with label
  • RadioButton - Radio button for single selection
  • Switch - Toggle switch component
  • Select - Dropdown selection component
  • Slider - Single value slider
  • RangeSlider - Dual-handle range slider
  • DatePicker - Date selection component
  • TimePicker - Time selection component
  • FileUpload - File upload with drag & drop support
  • Form & FormField - Form management components

Layout Components

  • Row - Horizontal layout with alignment controls
  • Column - Vertical layout with alignment controls
  • Box - Container with positioning capabilities
  • Grid - CSS Grid layout component
  • Spacer - Flexible spacing component
  • Divider - Visual separator
  • Card - Elevated container with shadow
  • AspectRatio - Maintains aspect ratio for content
  • ExpansionPanel - Collapsible/expandable panel
  • LazyColumn & LazyRow - Virtualized lists for performance
  • ResponsiveLayout - Responsive layout utilities

Display Components

  • Text - Text display with styling
  • Image - Image display component
  • Icon - Icon component with various sources
  • Badge - Small status indicator

Feedback Components

  • Alert - Dismissible alert messages
  • Snackbar & SnackbarHost - Temporary notifications
  • Progress & ProgressBar - Progress indicators
  • Tooltip - Hover tooltips

Navigation Components

  • Link - Navigation links
  • TabLayout - Tab-based navigation

Utility Components

  • Div - Basic container element
  • AccessibleElement - Accessibility wrapper

Inspiration

Summon is proudly inspired by Kobweb, a modern framework for full stack web apps in Kotlin built upon Compose HTML. Kobweb's elegant API design and approach to creating web applications using Kotlin has been instrumental in shaping Summon's philosophy. We highly recommend checking out Kobweb if you're looking for a mature, feature-rich solution for Kotlin web development.

Documentation

For detailed documentation, please check the docs directory:

API Reference

Comprehensive API reference documentation is available in the docs/api-reference directory:

Installation

Add Summon to your project dependencies from GitHub Packages:

repositories {
    maven {
        url = uri("https://maven.pkg.github.com/codeyousef/summon")
        credentials {
            username = project.findProperty("gpr.user") as String? ?: System.getenv("GITHUB_ACTOR")
            password = project.findProperty("gpr.key") as String? ?: System.getenv("GITHUB_TOKEN")
        }
    }
}

// Dependencies same as above

Note: GitHub Packages requires authentication. Add your credentials to ~/.gradle/gradle.properties:

gpr.user=YOUR_GITHUB_USERNAME
gpr.key=YOUR_GITHUB_TOKEN

Generate a GitHub token with read:packages permission at https://github.com/settings/tokens

Packages

 
 
 

Contributors 2

  •  
  •