Skip to content

Commit f765ea7

Browse files
committed
Docs.
1 parent c009fc1 commit f765ea7

File tree

2 files changed

+11
-8
lines changed

2 files changed

+11
-8
lines changed

README.md

+10-8
Original file line numberDiff line numberDiff line change
@@ -36,20 +36,20 @@ Use the [gallery](https://finnbear.github.io/yew_icons/) to find icons you like,
3636
# If still using yew 0.20, use yew_icons 0.7.3
3737

3838
[dependencies]
39-
yew_icons = {version = "0.8", features = ["LucideArrowLeftCircle", "LucideArrowRightCircle", "LucideArrowUpCircle"]}
39+
yew_icons = {version = "0.8", features = ["lucide"]}
4040
```
4141

42-
Then, add an `<Icon>` component with the corresponding icon id, optionally specifying a `width`, `height`, and/or `onclick` callback.
42+
Then, add an `<Icon>` component with the corresponding icon data, optionally specifying a `width`, `height`, and/or `onclick` callback.
4343

4444
```rust
4545
use yew::prelude::*;
46-
use yew_icons::{Icon, IconId};
46+
use yew_icons::{Icon, IconData};
4747

4848
html!{
4949
<>
50-
<Icon icon_id={IconId::LucideArrowLeftCircle}/>
51-
<Icon icon_id={IconId::LucideArrowUpCircle} width={"2em".to_owned()} height={"2em".to_owned()}/>
52-
<Icon icon_id={IconId::LucideArrowRightCircle} onclick={Callback::from(|_: MouseEvent| {})}/>
50+
<Icon data={IconData::LUCIDE_ARROW_LEFT_CIRCLE}/>
51+
<Icon data={IconData::LUCIDE_ARROW_UP_CIRCLE} width={"2em".to_owned()} height={"2em".to_owned()}/>
52+
<Icon data={IconData::LUCIDE_ARROW_RIGHT_CIRCLE} onclick={Callback::from(|_: MouseEvent| {})}/>
5353
</>
5454
}
5555
```
@@ -58,12 +58,14 @@ html!{
5858

5959
Note: The icons will inherit their parent's CSS `color`.
6060

61+
## 0.9.0 breaking change
62+
63+
To comply with the [new feature flag limit](https://blog.rust-lang.org/2023/10/26/broken-badges-and-23k-keywords.html), `yew_icons` no longer uses a feature per `IconId` enum variant. Instead, use features to enable collections and then use associated constants of `IconData`.
64+
6165
## Feature Flags
6266

6367
Each icon collection must be included with the corresponding feature flag, such as `lucide` or `font_awesome_solid`.
6468

65-
To save binary size, individual icons can also be included by feature flag, such as `LucideZoomIn` or `FontAwesomeSolidAtom`.
66-
6769
By default, no collections or icons are included. Be warned that including too many icons may result in a `.wasm` binary
6870
that some WebAssembly engines refuse to load, especially in debug mode (see <https://github.com/rustwasm/wasm-pack/issues/981>).
6971

src/lib.rs

+1
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ pub struct IconProps {
7272
/// For inline CSS.
7373
#[prop_or(None)]
7474
pub style: Option<AttrValue>,
75+
/// For accessibility.
7576
#[prop_or(None)]
7677
pub role: Option<AttrValue>,
7778
}

0 commit comments

Comments
 (0)