thaw/demo_markdown/docs/_guide/installation.md

48 lines
819 B
Markdown
Raw Normal View History

2024-07-30 21:53:36 +08:00
## Installation
Installation thaw
```shell
2024-02-09 22:44:22 +08:00
cargo add thaw --features=csr
```
2024-07-30 21:53:36 +08:00
2024-09-02 22:52:26 +08:00
<MessageBar intent=MessageBarIntent::Warning>
<MessageBarBody>
2024-09-20 00:13:40 +08:00
<div style="white-space: normal">
"If you are using the nightly feature in Leptos, please enable Thaw's nightly as well."
</div>
2024-09-02 22:52:26 +08:00
</MessageBarBody>
</MessageBar>
2024-07-30 21:53:36 +08:00
## Usage
You just need to import thaw and use it.
```rust
// Import all
use thaw::*;
// Import on Demand
use thaw::{Button, ButtonAppearance};
```
A small example:
```rust
use leptos::prelude::*;
use thaw::*;
fn main() {
mount_to_body(App);
}
#[component]
pub fn App() -> impl IntoView {
view! {
2024-08-06 10:59:34 +08:00
<ConfigProvider>
<Button appearance=ButtonAppearance::Primary>
"Primary"
</Button>
</ConfigProvider>
2024-07-30 21:53:36 +08:00
}
}
```