Expand description
§Leptos Components
A production-ready UI component library for Leptos applications.
§Features
This crate uses Cargo features to allow tree-shaking and selective inclusion
of components. By default, only the editor feature is enabled.
§Available Features
editor- Core text editor component with essential functionalitysyntax-highlighting- Syntax highlighting for code (requiressyntect)markdown- Markdown parsing and rendering (requirescomrak)find-replace- Find and replace functionalityfolding- Code folding supportstatistics- Document statistics (word count, character count, etc.)line-numbers- Line number gutter displayminimap- VS Code-style minimap navigationeditor-full- All editor features combinedssr- Server-side rendering supporthydrate- Hydration supportcsr- Client-side rendering only
§Quick Start
ⓘ
use leptos::prelude::*;
use longcipher_leptos_components::editor::Editor;
#[component]
fn App() -> impl IntoView {
let (content, set_content) = signal(String::from("Hello, World!"));
view! {
<Editor
value=content
on_change=move |new_value| set_content.set(new_value)
placeholder="Enter text..."
/>
}
}§Design Principles
All components in this library follow these principles:
- Props with
#[prop(into)]- Allow flexible input types - Optional props with defaults - Sensible defaults for all optional props
- Custom styling via
class- Every component accepts aclassprop - Return
impl IntoView- Standard Leptos return type - Accessibility first - ARIA attributes and keyboard navigation
- SSR compatible - Works with server-side rendering
§Component Categories
- Editor - Rich text and code editing components
- Display - Read-only content display components (planned)
- Input - Form input components (planned)
- Feedback - Alerts, toasts, and notifications (planned)
- Navigation - Menus, tabs, and navigation components (planned)
Re-exports§
pub use leptos;
Modules§
- components
- Component modules
- editor
editor - Editor components
- helpers
- Internal helper utilities
- prelude
- Prelude module for convenient imports