Skip to main content

Crate coders

Crate coders 

Source
Expand description

Β§πŸ’» Code RS

Crates.io Crates.io Downloads Crates.io License made-with-rust Rust Maintenance

Open SASS Discord

logo

§🎬 Demo

FrameworkLive Demo
YewNetlify Status
DioxusNetlify Status
LeptosNetlify Status

Β§πŸ“œ Intro

A highly customizable, accessible inline code and code-block component for WASM frameworks: Yew, Dioxus, and Leptos. Supports multiple colors, variants, sizes, copy-to-clipboard, and composable sub-components, all WCAG compliant.

Β§πŸ€” Why Code RS?

  1. 🎨 Fully Customizable: Control every attribute, class, style, color, variant, size, ARIA labels, and more.
  2. πŸ“‹ Copy to Clipboard: Built-in copy button with a configurable confirmation label and reset timeout.
  3. 🧩 Composable: Compose Header, Title, CopyTrigger, Content, and LanguageBadge independently.
  4. β™Ώ Accessible by Default: role="region", aria-label, aria-live and tabindex wired up automatically.
  5. πŸ”§ Framework Agnostic: Same API semantics across Yew, Dioxus, and Leptos.

Β§Y Yew Usage

Refer to our guide to integrate this component into your Yew app.

§🧬 Dioxus Usage

Refer to our guide to integrate this component into your Dioxus app.

§🌱 Leptos Usage

Refer to our guide to integrate this component into your Leptos app.

§🀝 Contributions

Contributions are welcome! Whether it’s bug fixes, feature requests, or examples, we would love your help to make Code RS better.

  1. Fork the repository.
  2. Create a new branch for your feature/bugfix.
  3. Submit a pull request for review.

Β§πŸ“œ License

Code RS is licensed under the MIT License. You are free to use, modify, and distribute this library in your projects.

Re-exportsΒ§

pub use common::Color;
pub use common::Language;
pub use common::Size;
pub use common::Theme;
pub use common::ThemeColors;
pub use common::Variant;
pub use common::highlight_code;
pub use common::themed_block_style;
pub use common::themed_header_style;
pub use common::themed_pre_style;

ModulesΒ§

common
dioxusdio
🧬 Dioxus Code RS
leptoslep
🌱 Leptos Code RS
yewyew
Y Yew Code RS