A production-ready UI component library for Leptos applications.
- 🚀 Production-ready components with sensible defaults
- 🎯 Type-safe props using Leptos's component system
- 📦 Tree-shakeable via Cargo feature flags
- 🌐 SSR/CSR compatible for full-stack applications
- ♿ Accessible following WCAG 2.1 guidelines
- 🎨 Themeable via CSS custom properties
Add to your Cargo.toml:
[dependencies]
longcipher-leptos-components = { version = "0.1", features = ["editor"] }use leptos::prelude::*;
use longcipher_leptos_components::editor::Editor;
#[component]
fn App() -> impl IntoView {
let (content, set_content) = signal(String::new());
view! {
<Editor
value=content
on_change=move |v| set_content.set(v)
language="rust"
show_line_numbers=true
placeholder="Start typing..."
/>
}
}A full-featured text editor with:
- Syntax highlighting (feature:
syntax-highlighting) - Line numbers
- Find & Replace (feature:
find-replace) - Undo/Redo
- Code folding (feature:
folding) - Document statistics (feature:
statistics)
<Editor
value=content
on_change=move |v| set_content.set(v)
language="markdown"
show_line_numbers=true
word_wrap=true
tab_size=4
font_size=14.0
highlight_current_line=true
match_brackets=true
/>| Feature | Description |
|---|---|
editor |
Core text editor (default) |
syntax-highlighting |
Code syntax coloring |
markdown |
Markdown parsing and preview |
find-replace |
Search and replace |
folding |
Code folding |
statistics |
Word/character counts |
line-numbers |
Line number gutter |
minimap |
VS Code-style navigation |
editor-full |
All editor features |
ssr |
Server-side rendering |
hydrate |
Hydration support |
csr |
Client-side only |
# Minimal editor
longcipher-leptos-components = { version = "0.1", features = ["editor"] }
# Full-featured editor
longcipher-leptos-components = { version = "0.1", features = ["editor-full"] }
# With SSR support
longcipher-leptos-components = { version = "0.1", features = ["editor", "ssr"] }Components use CSS custom properties for easy theming:
.leptos-editor {
--editor-bg: #1e1e1e;
--editor-fg: #d4d4d4;
--editor-line-number-fg: #858585;
--editor-selection-bg: #264f78;
--editor-cursor: #aeafad;
--editor-border: #3c3c3c;
}
/* Light theme */
.leptos-editor.light {
--editor-bg: #ffffff;
--editor-fg: #1e293b;
--editor-border: #e2e8f0;
}All components follow these standards:
#[prop(into)]- Flexible input types- Optional props with defaults - Works with minimal config
classprop - Custom styling supportimpl IntoView- Standard Leptos return type- Controlled components - External state management
- Accessible by default - ARIA labels and keyboard support
- Library Design - Architecture and standards
- Editor Design - Editor component details
- API Reference - Full API docs
- Examples - Code examples
Contributions are welcome! Please read our contributing guidelines.
# Run tests
cargo test --all-features
# Check lints
cargo clippy --all-features
# Format code
cargo fmt
# Build docs
cargo doc --all-features --openLicensed under MIT License.
- Built with Leptos
- Design system by ui-ux-pro-max