Skip to content
Prev Previous commit
Next Next commit
Update Progress to Leptos 0.7
  • Loading branch information
geoffreygarrett committed Jan 8, 2025
commit 358f96bc141fe82f7b7f65a267721d6224606eb9
32 changes: 16 additions & 16 deletions book/src/primitives/components/progress.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ files = ["src/progress.rs"]

## Features

- Provides context for assistive technology to read the progress of a task.
- Provides context for assistive technology to read the progress of a task.

## Installation

Expand All @@ -29,9 +29,9 @@ Install the component from your command line.
cargo add radix-leptos-progress
```

- [View on crates.io](https://crates.io/crates/radix-leptos-progress)
- [View on docs.rs](https://docs.rs/radix-leptos-progress/latest/radix_leptos_progress/)
- [View source](https://github.com/RustForWeb/radix/tree/main/packages/primitives/leptos/progress)
- [View on crates.io](https://crates.io/crates/radix-leptos-progress)
- [View on docs.rs](https://docs.rs/radix-leptos-progress/latest/radix_leptos_progress/)
- [View source](https://github.com/RustForWeb/radix/tree/main/packages/primitives/leptos/progress)

{{#endtab }}
{{#endtabs }}
Expand All @@ -45,14 +45,14 @@ Import all parts and piece them together.

```rust,ignore
use leptos::*;
use radix_leptos_progress::*;
use radix_leptos_progress::primitive as Progress;

#[component]
fn Anatomy() -> impl IntoView {
view! {
<Progress>
<ProgressIndicator />
</Progress>
<Progress::Root>
<Progress::Indicator />
</Progress::Root>
}
}
```
Expand All @@ -70,19 +70,19 @@ Contains all of the progress parts.
{{#tab name="Leptos" }}

| Prop | Type | Default |
| ----------------- | -------------------------------------- | ------- |
|-------------------|----------------------------------------|---------|
| `as_child` | `MaybeProp<bool>` | `false` |
| `value` | `MaybeProp<f64>` | - |
| `value` | `MaybeProp<f64>` | |
| `max` | `MaybeProp<f64>` | `100.0` |
| `get_value_label` | `Option<Callback<(f64, f64), String>>` | - |
| `get_value_label` | `Option<Callback<(f64, f64), String>>` | |

{{#endtab }}
{{#endtabs }}

<div style="height: 1em;"></div>

| Data attribute | Values |
| -------------- | -------------------------------------------- |
|----------------|----------------------------------------------|
| `[data-state]` | `"complete" \| "indeterminate" \| "loading"` |
| `[data-value]` | The current value |
| `[data-max]` | The max value |
Expand All @@ -95,7 +95,7 @@ Used to show the progress visually. It also makes progress accessible to assisti
{{#tab name="Leptos" }}

| Prop | Type | Default |
| ---------- | ----------------- | ------- |
|------------|-------------------|---------|
| `as_child` | `MaybeProp<bool>` | `false` |

{{#endtab }}
Expand All @@ -104,15 +104,15 @@ Used to show the progress visually. It also makes progress accessible to assisti
<div style="height: 1em;"></div>

| Data attribute | Values |
| -------------- | -------------------------------------------- |
|----------------|----------------------------------------------|
| `[data-state]` | `"complete" \| "indeterminate" \| "loading"` |
| `[data-value]` | The current value |
| `[data-max]` | The max value |

## Accessibility

Adheres to the [`progressbar` role requirements](https://www.w3.org/WAI/ARIA/apg/patterns/meter/).
Adheres to the [`progressbar` role requirements](https://www.w3.org/WAI/ARIA/apg/patterns/meter).

## See Also

- [Radix documentation](https://www.radix-ui.com/primitives/docs/components/progress)
- [Radix documentation](https://www.radix-ui.com/primitives/docs/components/progress)
3 changes: 3 additions & 0 deletions packages/primitives/leptos/progress/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,6 @@ version.workspace = true

[dependencies]
leptos.workspace = true
leptos-node-ref.workspace = true
radix-leptos-primitive.workspace = true
radix-leptos-context.workspace = true
2 changes: 2 additions & 0 deletions packages/primitives/leptos/progress/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
//!
//! See [`@radix-ui/react-progress`](https://www.npmjs.com/package/@radix-ui/react-progress) for the original package.

extern crate core;

mod progress;

pub use progress::*;
Loading