├── scripts
├── src
│ ├── lib.rs
│ └── bin
│ │ └── templates
│ │ └── base_styles.css
└── Cargo.toml
├── .prettierignore
├── packages
├── leptos
│ ├── utils
│ │ ├── src
│ │ │ ├── default.rs
│ │ │ ├── new_york.rs
│ │ │ └── lib.rs
│ │ ├── Cargo.toml
│ │ └── README.md
│ ├── alert
│ │ ├── src
│ │ │ └── lib.rs
│ │ ├── Cargo.toml
│ │ └── README.md
│ ├── card
│ │ ├── src
│ │ │ └── lib.rs
│ │ ├── Cargo.toml
│ │ └── README.md
│ ├── badge
│ │ ├── src
│ │ │ ├── lib.rs
│ │ │ ├── default.rs
│ │ │ └── new_york.rs
│ │ ├── Cargo.toml
│ │ └── README.md
│ └── button
│ │ ├── src
│ │ └── lib.rs
│ │ ├── Cargo.toml
│ │ └── README.md
├── shadcn
│ ├── src
│ │ ├── commands
│ │ │ ├── add.rs
│ │ │ └── diff.rs
│ │ ├── preflights.rs
│ │ ├── commands.rs
│ │ ├── lib.rs
│ │ ├── utils.rs
│ │ ├── utils
│ │ │ ├── errors.rs
│ │ │ ├── get_project_info.rs
│ │ │ ├── logger.rs
│ │ │ ├── spinner.rs
│ │ │ └── highlighter.rs
│ │ └── bin
│ │ │ └── rust-shadcn.rs
│ └── Cargo.toml
├── yew
│ ├── aspect-ratio
│ │ ├── src
│ │ │ ├── default.rs
│ │ │ ├── new_york.rs
│ │ │ └── lib.rs
│ │ ├── Cargo.toml
│ │ └── README.md
│ ├── table
│ │ ├── src
│ │ │ └── lib.rs
│ │ ├── Cargo.toml
│ │ └── README.md
│ ├── alert
│ │ ├── src
│ │ │ └── lib.rs
│ │ ├── Cargo.toml
│ │ └── README.md
│ ├── card
│ │ ├── src
│ │ │ └── lib.rs
│ │ ├── Cargo.toml
│ │ └── README.md
│ ├── label
│ │ ├── src
│ │ │ ├── lib.rs
│ │ │ ├── default.rs
│ │ │ └── new_york.rs
│ │ ├── Cargo.toml
│ │ └── README.md
│ ├── badge
│ │ ├── src
│ │ │ ├── lib.rs
│ │ │ ├── default.rs
│ │ │ └── new_york.rs
│ │ ├── Cargo.toml
│ │ └── README.md
│ ├── separator
│ │ ├── src
│ │ │ ├── lib.rs
│ │ │ ├── default.rs
│ │ │ └── new_york.rs
│ │ ├── Cargo.toml
│ │ └── README.md
│ ├── avatar
│ │ ├── src
│ │ │ └── lib.rs
│ │ ├── Cargo.toml
│ │ └── README.md
│ ├── button
│ │ ├── src
│ │ │ └── lib.rs
│ │ ├── Cargo.toml
│ │ └── README.md
│ ├── skeleton
│ │ ├── src
│ │ │ ├── lib.rs
│ │ │ ├── default.rs
│ │ │ └── new_york.rs
│ │ ├── Cargo.toml
│ │ └── README.md
│ ├── input
│ │ ├── src
│ │ │ └── lib.rs
│ │ ├── Cargo.toml
│ │ └── README.md
│ ├── pagination
│ │ ├── src
│ │ │ └── lib.rs
│ │ ├── Cargo.toml
│ │ └── README.md
│ ├── switch
│ │ ├── src
│ │ │ └── lib.rs
│ │ ├── Cargo.toml
│ │ └── README.md
│ ├── textarea
│ │ ├── src
│ │ │ └── lib.rs
│ │ ├── Cargo.toml
│ │ └── README.md
│ └── breadcrumb
│ │ ├── src
│ │ └── lib.rs
│ │ ├── Cargo.toml
│ │ └── README.md
└── registry
│ ├── Cargo.toml
│ └── src
│ ├── registry_blocks.rs
│ ├── registry_charts.rs
│ ├── registry_hooks.rs
│ ├── registry_examples.rs
│ ├── registry_styles.rs
│ ├── registry_frameworks.rs
│ ├── registry_ui.rs
│ └── lib.rs
├── book
├── src
│ ├── getting-started
│ │ └── README.md
│ ├── components
│ │ ├── README.md
│ │ ├── label.md
│ │ └── separator.md
│ └── SUMMARY.md
├── theme
│ ├── theme.css
│ ├── theme.js
│ ├── tabs.css
│ ├── trunk.css
│ └── trunk.js
└── book.toml
├── book-examples
├── leptos
│ ├── src
│ │ ├── default
│ │ │ ├── components.rs
│ │ │ ├── badge
│ │ │ │ ├── badge.rs
│ │ │ │ ├── badge_outline.rs
│ │ │ │ ├── badge_secondary.rs
│ │ │ │ └── badge_destructive.rs
│ │ │ ├── button
│ │ │ │ ├── button.rs
│ │ │ │ ├── button_ghost.rs
│ │ │ │ ├── button_link.rs
│ │ │ │ ├── button_outline.rs
│ │ │ │ ├── button_secondary.rs
│ │ │ │ ├── button_destructive.rs
│ │ │ │ ├── button_with_icon.rs
│ │ │ │ ├── button_loading.rs
│ │ │ │ ├── button_icon.rs
│ │ │ │ └── button_as_child.rs
│ │ │ ├── components
│ │ │ │ └── ui.rs
│ │ │ ├── alert
│ │ │ │ ├── alert.rs
│ │ │ │ └── alert_destructive.rs
│ │ │ ├── card.rs
│ │ │ ├── alert.rs
│ │ │ ├── badge.rs
│ │ │ └── button.rs
│ │ ├── new_york
│ │ │ ├── components.rs
│ │ │ ├── badge
│ │ │ │ ├── badge.rs
│ │ │ │ ├── badge_outline.rs
│ │ │ │ ├── badge_secondary.rs
│ │ │ │ └── badge_destructive.rs
│ │ │ ├── button
│ │ │ │ ├── button.rs
│ │ │ │ ├── button_link.rs
│ │ │ │ ├── button_ghost.rs
│ │ │ │ ├── button_outline.rs
│ │ │ │ ├── button_secondary.rs
│ │ │ │ ├── button_destructive.rs
│ │ │ │ ├── button_with_icon.rs
│ │ │ │ ├── button_loading.rs
│ │ │ │ ├── button_icon.rs
│ │ │ │ └── button_as_child.rs
│ │ │ ├── components
│ │ │ │ └── ui.rs
│ │ │ ├── alert
│ │ │ │ ├── alert.rs
│ │ │ │ └── alert_destructive.rs
│ │ │ ├── card.rs
│ │ │ ├── alert.rs
│ │ │ ├── badge.rs
│ │ │ └── button.rs
│ │ ├── main.rs
│ │ ├── app.rs
│ │ ├── default.rs
│ │ └── new_york.rs
│ ├── Trunk.toml
│ ├── index.html
│ ├── main.js
│ └── Cargo.toml
└── yew
│ ├── src
│ ├── default
│ │ ├── components.rs
│ │ ├── input
│ │ │ ├── input_form.rs
│ │ │ ├── input.rs
│ │ │ ├── input_disabled.rs
│ │ │ ├── input_file.rs
│ │ │ ├── input_with_button.rs
│ │ │ ├── input_with_label.rs
│ │ │ └── input_with_text.rs
│ │ ├── switch
│ │ │ ├── switch_form.rs
│ │ │ └── switch.rs
│ │ ├── badge
│ │ │ ├── badge.rs
│ │ │ ├── badge_outline.rs
│ │ │ ├── badge_secondary.rs
│ │ │ └── badge_destructive.rs
│ │ ├── textarea
│ │ │ ├── textarea_form.rs
│ │ │ ├── textarea.rs
│ │ │ ├── textarea_disabled.rs
│ │ │ ├── textarea_with_button.rs
│ │ │ ├── textarea_with_label.rs
│ │ │ └── textarea_with_text.rs
│ │ ├── button
│ │ │ ├── button.rs
│ │ │ ├── button_link.rs
│ │ │ ├── button_ghost.rs
│ │ │ ├── button_outline.rs
│ │ │ ├── button_secondary.rs
│ │ │ ├── button_destructive.rs
│ │ │ ├── button_with_icon.rs
│ │ │ ├── button_loading.rs
│ │ │ ├── button_icon.rs
│ │ │ └── button_as_child.rs
│ │ ├── breadcrumb
│ │ │ ├── breadcrumb_responsive.rs
│ │ │ ├── breadcrumb_separator.rs
│ │ │ ├── breadcrumb_link.rs
│ │ │ ├── breadcrumb_ellipsis.rs
│ │ │ └── breadcrumb_dropdown.rs
│ │ ├── label.rs
│ │ ├── table.rs
│ │ ├── avatar.rs
│ │ ├── avatar
│ │ │ └── avatar.rs
│ │ ├── separator.rs
│ │ ├── pagination.rs
│ │ ├── aspect_ratio.rs
│ │ ├── label
│ │ │ └── label.rs
│ │ ├── skeleton
│ │ │ ├── skeleton.rs
│ │ │ └── skeleton_card.rs
│ │ ├── alert
│ │ │ ├── alert.rs
│ │ │ └── alert_destructive.rs
│ │ ├── switch.rs
│ │ ├── card.rs
│ │ ├── skeleton.rs
│ │ ├── aspect_ratio
│ │ │ └── aspect_ratio.rs
│ │ ├── alert.rs
│ │ ├── badge.rs
│ │ ├── separator
│ │ │ └── separator.rs
│ │ ├── textarea.rs
│ │ ├── breadcrumb.rs
│ │ ├── input.rs
│ │ ├── pagination
│ │ │ └── pagination.rs
│ │ ├── components
│ │ │ └── ui.rs
│ │ └── button.rs
│ ├── new_york
│ │ ├── components.rs
│ │ ├── input
│ │ │ ├── input_form.rs
│ │ │ ├── input.rs
│ │ │ ├── input_disabled.rs
│ │ │ ├── input_file.rs
│ │ │ ├── input_with_label.rs
│ │ │ ├── input_with_button.rs
│ │ │ └── input_with_text.rs
│ │ ├── switch
│ │ │ ├── switch_form.rs
│ │ │ └── switch.rs
│ │ ├── badge
│ │ │ ├── badge.rs
│ │ │ ├── badge_outline.rs
│ │ │ ├── badge_secondary.rs
│ │ │ └── badge_destructive.rs
│ │ ├── button
│ │ │ ├── button.rs
│ │ │ ├── button_link.rs
│ │ │ ├── button_ghost.rs
│ │ │ ├── button_outline.rs
│ │ │ ├── button_secondary.rs
│ │ │ ├── button_destructive.rs
│ │ │ ├── button_with_icon.rs
│ │ │ ├── button_loading.rs
│ │ │ ├── button_icon.rs
│ │ │ └── button_as_child.rs
│ │ ├── textarea
│ │ │ ├── textarea_form.rs
│ │ │ ├── textarea.rs
│ │ │ ├── textarea_disabled.rs
│ │ │ ├── textarea_with_button.rs
│ │ │ ├── textarea_with_label.rs
│ │ │ └── textarea_with_text.rs
│ │ ├── breadcrumb
│ │ │ ├── breadcrumb_responsive.rs
│ │ │ ├── breadcrumb_separator.rs
│ │ │ ├── breadcrumb_link.rs
│ │ │ ├── breadcrumb_ellipsis.rs
│ │ │ └── breadcrumb_dropdown.rs
│ │ ├── label.rs
│ │ ├── table.rs
│ │ ├── avatar.rs
│ │ ├── avatar
│ │ │ └── avatar.rs
│ │ ├── separator.rs
│ │ ├── pagination.rs
│ │ ├── aspect_ratio.rs
│ │ ├── label
│ │ │ └── label.rs
│ │ ├── skeleton
│ │ │ ├── skeleton.rs
│ │ │ └── skeleton_card.rs
│ │ ├── switch.rs
│ │ ├── alert
│ │ │ ├── alert.rs
│ │ │ └── alert_destructive.rs
│ │ ├── card.rs
│ │ ├── aspect_ratio
│ │ │ └── aspect_ratio.rs
│ │ ├── skeleton.rs
│ │ ├── alert.rs
│ │ ├── badge.rs
│ │ ├── separator
│ │ │ └── separator.rs
│ │ ├── textarea.rs
│ │ ├── breadcrumb.rs
│ │ ├── input.rs
│ │ ├── pagination
│ │ │ └── pagination.rs
│ │ ├── components
│ │ │ └── ui.rs
│ │ └── button.rs
│ ├── main.rs
│ └── app.rs
│ ├── Trunk.toml
│ ├── index.html
│ └── main.js
├── .github
├── FUNDING.yml
├── renovate.json
└── workflows
│ ├── labels.yml
│ └── ci.yml
├── .prettierrc.json
├── components.toml
├── package.json
├── deny.toml
├── LICENSE.md
├── .pre-commit-config.yaml
├── Cargo.toml
└── README.md
/scripts/src/lib.rs:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/.prettierignore:
--------------------------------------------------------------------------------
1 | .vite/
2 | target/
3 |
--------------------------------------------------------------------------------
/packages/leptos/utils/src/default.rs:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/packages/leptos/utils/src/new_york.rs:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/packages/shadcn/src/commands/add.rs:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/packages/shadcn/src/commands/diff.rs:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/book/src/getting-started/README.md:
--------------------------------------------------------------------------------
1 | # Getting Started
2 |
--------------------------------------------------------------------------------
/book-examples/leptos/src/default/components.rs:
--------------------------------------------------------------------------------
1 | pub mod ui;
2 |
--------------------------------------------------------------------------------
/book-examples/leptos/src/new_york/components.rs:
--------------------------------------------------------------------------------
1 | pub mod ui;
2 |
--------------------------------------------------------------------------------
/book-examples/yew/src/default/components.rs:
--------------------------------------------------------------------------------
1 | pub mod ui;
2 |
--------------------------------------------------------------------------------
/book-examples/yew/src/new_york/components.rs:
--------------------------------------------------------------------------------
1 | pub mod ui;
2 |
--------------------------------------------------------------------------------
/book/theme/theme.css:
--------------------------------------------------------------------------------
1 | table {
2 | margin: unset;
3 | }
4 |
--------------------------------------------------------------------------------
/packages/shadcn/src/preflights.rs:
--------------------------------------------------------------------------------
1 | pub mod preflight_init;
2 |
--------------------------------------------------------------------------------
/.github/FUNDING.yml:
--------------------------------------------------------------------------------
1 | github: RustForWeb
2 | open_collective: rustforweb
3 |
--------------------------------------------------------------------------------
/packages/yew/aspect-ratio/src/default.rs:
--------------------------------------------------------------------------------
1 | pub use radix_yew_aspect_ratio::*;
2 |
--------------------------------------------------------------------------------
/packages/yew/aspect-ratio/src/new_york.rs:
--------------------------------------------------------------------------------
1 | pub use radix_yew_aspect_ratio::*;
2 |
--------------------------------------------------------------------------------
/packages/shadcn/src/commands.rs:
--------------------------------------------------------------------------------
1 | pub mod add;
2 | pub mod diff;
3 | pub mod init;
4 |
--------------------------------------------------------------------------------
/scripts/src/bin/templates/base_styles.css:
--------------------------------------------------------------------------------
1 | @tailwind base;
2 | @tailwind components;
3 | @tailwind utilities;
4 |
--------------------------------------------------------------------------------
/packages/shadcn/src/lib.rs:
--------------------------------------------------------------------------------
1 | // TODO: remove
2 | #![allow(unused)]
3 |
4 | pub mod commands;
5 | mod preflights;
6 | mod utils;
7 |
--------------------------------------------------------------------------------
/packages/shadcn/src/utils.rs:
--------------------------------------------------------------------------------
1 | pub mod errors;
2 | pub mod get_project_info;
3 | pub mod highlighter;
4 | pub mod logger;
5 | pub mod spinner;
6 |
--------------------------------------------------------------------------------
/.github/renovate.json:
--------------------------------------------------------------------------------
1 | {
2 | "$schema": "https://docs.renovatebot.com/renovate-schema.json",
3 | "extends": ["github>RustForWeb/.github:renovate-config"]
4 | }
5 |
--------------------------------------------------------------------------------
/.prettierrc.json:
--------------------------------------------------------------------------------
1 | {
2 | "plugins": ["prettier-plugin-tailwindcss"],
3 | "bracketSpacing": false,
4 | "printWidth": 120,
5 | "singleQuote": true,
6 | "tabWidth": 4
7 | }
8 |
--------------------------------------------------------------------------------
/components.toml:
--------------------------------------------------------------------------------
1 | style = "default"
2 |
3 | [tailwind]
4 | config = "tailwind.config.js"
5 | css = "src/styles/global.css"
6 | base_color = "slate"
7 | css_variables = true
8 | prefix = ""
9 |
--------------------------------------------------------------------------------
/book-examples/leptos/Trunk.toml:
--------------------------------------------------------------------------------
1 | [[hooks]]
2 | stage = "pre_build"
3 | command = "sh"
4 | command_arguments = [
5 | "-c",
6 | "npx tailwindcss -i style/tailwind.css -o style/tailwind.output.css",
7 | ]
8 |
--------------------------------------------------------------------------------
/book-examples/yew/Trunk.toml:
--------------------------------------------------------------------------------
1 | [[hooks]]
2 | stage = "pre_build"
3 | command = "sh"
4 | command_arguments = [
5 | "-c",
6 | "npx tailwindcss -i style/tailwind.css -o style/tailwind.output.css",
7 | ]
8 |
--------------------------------------------------------------------------------
/book-examples/yew/src/default/input/input_form.rs:
--------------------------------------------------------------------------------
1 | use yew::prelude::*;
2 |
3 | // use crate::default::components::ui::input::Input;
4 |
5 | #[function_component]
6 | pub fn InputForm() -> Html {
7 | html! {
8 | // TODO
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/book-examples/yew/src/default/switch/switch_form.rs:
--------------------------------------------------------------------------------
1 | use yew::prelude::*;
2 |
3 | // use crate::default::components::ui::switch::Switch;
4 |
5 | #[function_component]
6 | pub fn SwitchForm() -> Html {
7 | html! {
8 | // TODO
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/book-examples/yew/src/new_york/input/input_form.rs:
--------------------------------------------------------------------------------
1 | use yew::prelude::*;
2 |
3 | // use crate::new_york::components::ui::input::Input;
4 |
5 | #[function_component]
6 | pub fn InputForm() -> Html {
7 | html! {
8 | // TODO
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/book-examples/yew/src/default/badge/badge.rs:
--------------------------------------------------------------------------------
1 | use yew::prelude::*;
2 |
3 | use crate::default::components::ui::badge::Badge;
4 |
5 | #[function_component]
6 | pub fn BadgeDemo() -> Html {
7 | html! {
8 | {"Badge"}
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/book-examples/yew/src/new_york/switch/switch_form.rs:
--------------------------------------------------------------------------------
1 | use yew::prelude::*;
2 |
3 | // use crate::default::components::ui::switch::Switch;
4 |
5 | #[function_component]
6 | pub fn SwitchForm() -> Html {
7 | html! {
8 | // TODO
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/book-examples/leptos/src/default/badge/badge.rs:
--------------------------------------------------------------------------------
1 | use leptos::prelude::*;
2 |
3 | use crate::default::components::ui::badge::Badge;
4 |
5 | #[component]
6 | pub fn BadgeDemo() -> impl IntoView {
7 | view! {
8 | {"Badge"}
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/book-examples/yew/src/default/textarea/textarea_form.rs:
--------------------------------------------------------------------------------
1 | use yew::prelude::*;
2 |
3 | // use crate::default::components::ui::textarea::Textarea;
4 |
5 | #[function_component]
6 | pub fn TextareaForm() -> Html {
7 | html! {
8 | // TODO
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/book-examples/yew/src/new_york/badge/badge.rs:
--------------------------------------------------------------------------------
1 | use yew::prelude::*;
2 |
3 | use crate::new_york::components::ui::badge::Badge;
4 |
5 | #[function_component]
6 | pub fn BadgeDemo() -> Html {
7 | html! {
8 | {"Badge"}
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/book-examples/leptos/src/new_york/badge/badge.rs:
--------------------------------------------------------------------------------
1 | use leptos::prelude::*;
2 |
3 | use crate::new_york::components::ui::badge::Badge;
4 |
5 | #[component]
6 | pub fn BadgeDemo() -> impl IntoView {
7 | view! {
8 | {"Badge"}
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/book-examples/yew/src/default/button/button.rs:
--------------------------------------------------------------------------------
1 | use yew::prelude::*;
2 |
3 | use crate::default::components::ui::button::Button;
4 |
5 | #[function_component]
6 | pub fn ButtonDemo() -> Html {
7 | html! {
8 |
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/book-examples/yew/src/new_york/button/button.rs:
--------------------------------------------------------------------------------
1 | use yew::prelude::*;
2 |
3 | use crate::new_york::components::ui::button::Button;
4 |
5 | #[function_component]
6 | pub fn ButtonDemo() -> Html {
7 | html! {
8 |
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/book-examples/yew/src/new_york/textarea/textarea_form.rs:
--------------------------------------------------------------------------------
1 | use yew::prelude::*;
2 |
3 | // use crate::new_york::components::ui::textarea::Textarea;
4 |
5 | #[function_component]
6 | pub fn TextareaForm() -> Html {
7 | html! {
8 | // TODO
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/book-examples/leptos/src/default/button/button.rs:
--------------------------------------------------------------------------------
1 | use leptos::prelude::*;
2 |
3 | use crate::default::components::ui::button::Button;
4 |
5 | #[component]
6 | pub fn ButtonDemo() -> impl IntoView {
7 | view! {
8 |
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/book-examples/leptos/src/new_york/button/button.rs:
--------------------------------------------------------------------------------
1 | use leptos::prelude::*;
2 |
3 | use crate::new_york::components::ui::button::Button;
4 |
5 | #[component]
6 | pub fn ButtonDemo() -> impl IntoView {
7 | view! {
8 |
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/book-examples/yew/src/default/input/input.rs:
--------------------------------------------------------------------------------
1 | use yew::prelude::*;
2 |
3 | use crate::default::components::ui::input::Input;
4 |
5 | #[function_component]
6 | pub fn InputDemo() -> Html {
7 | html! {
8 |
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/book-examples/yew/src/new_york/input/input.rs:
--------------------------------------------------------------------------------
1 | use yew::prelude::*;
2 |
3 | use crate::new_york::components::ui::input::Input;
4 |
5 | #[function_component]
6 | pub fn InputDemo() -> Html {
7 | html! {
8 |
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/book-examples/yew/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/book-examples/leptos/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/book-examples/yew/src/default/textarea/textarea.rs:
--------------------------------------------------------------------------------
1 | use yew::prelude::*;
2 |
3 | use crate::default::components::ui::textarea::Textarea;
4 |
5 | #[function_component]
6 | pub fn TextareaDemo() -> Html {
7 | html! {
8 |
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/book-examples/yew/src/main.rs:
--------------------------------------------------------------------------------
1 | mod app;
2 | mod default;
3 | mod new_york;
4 |
5 | use crate::app::App;
6 |
7 | pub fn main() {
8 | _ = console_log::init_with_level(log::Level::Debug);
9 | console_error_panic_hook::set_once();
10 |
11 | yew::Renderer::::new().render();
12 | }
13 |
--------------------------------------------------------------------------------
/book-examples/yew/src/new_york/textarea/textarea.rs:
--------------------------------------------------------------------------------
1 | use yew::prelude::*;
2 |
3 | use crate::new_york::components::ui::textarea::Textarea;
4 |
5 | #[function_component]
6 | pub fn TextareaDemo() -> Html {
7 | html! {
8 |
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/book-examples/yew/src/default/input/input_disabled.rs:
--------------------------------------------------------------------------------
1 | use yew::prelude::*;
2 |
3 | use crate::default::components::ui::input::Input;
4 |
5 | #[function_component]
6 | pub fn InputDisabled() -> Html {
7 | html! {
8 |
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/book-examples/yew/src/new_york/input/input_disabled.rs:
--------------------------------------------------------------------------------
1 | use yew::prelude::*;
2 |
3 | use crate::new_york::components::ui::input::Input;
4 |
5 | #[function_component]
6 | pub fn InputDisabled() -> Html {
7 | html! {
8 |
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/book-examples/leptos/src/main.rs:
--------------------------------------------------------------------------------
1 | mod app;
2 | mod default;
3 | mod new_york;
4 |
5 | use leptos::prelude::*;
6 |
7 | use crate::app::App;
8 |
9 | pub fn main() {
10 | _ = console_log::init_with_level(log::Level::Debug);
11 | console_error_panic_hook::set_once();
12 |
13 | mount_to_body(App);
14 | }
15 |
--------------------------------------------------------------------------------
/book-examples/yew/src/default/badge/badge_outline.rs:
--------------------------------------------------------------------------------
1 | use yew::prelude::*;
2 |
3 | use crate::default::components::ui::badge::{Badge, BadgeVariant};
4 |
5 | #[function_component]
6 | pub fn BadgeOutline() -> Html {
7 | html! {
8 | {"Outline"}
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/book-examples/yew/src/default/button/button_link.rs:
--------------------------------------------------------------------------------
1 | use yew::prelude::*;
2 |
3 | use crate::default::components::ui::button::{Button, ButtonVariant};
4 |
5 | #[function_component]
6 | pub fn ButtonLink() -> Html {
7 | html! {
8 |
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/book-examples/yew/src/new_york/button/button_link.rs:
--------------------------------------------------------------------------------
1 | use yew::prelude::*;
2 |
3 | use crate::new_york::components::ui::button::{Button, ButtonVariant};
4 |
5 | #[function_component]
6 | pub fn ButtonLink() -> Html {
7 | html! {
8 |
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/packages/yew/table/src/lib.rs:
--------------------------------------------------------------------------------
1 | //! Yew port of [shadcn/ui Table](https://ui.shadcn.com/docs/components/table).
2 | //!
3 | //! A responsive table component.
4 | //!
5 | //! See [the Rust shadcn/ui book](https://shadcn-ui.rustforweb.org/components/table.html) for more documenation.
6 |
7 | pub mod default;
8 | pub mod new_york;
9 |
--------------------------------------------------------------------------------
/book-examples/leptos/src/default/button/button_ghost.rs:
--------------------------------------------------------------------------------
1 | use leptos::prelude::*;
2 |
3 | use crate::default::components::ui::button::{Button, ButtonVariant};
4 |
5 | #[component]
6 | pub fn ButtonGhost() -> impl IntoView {
7 | view! {
8 |
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/book-examples/leptos/src/default/button/button_link.rs:
--------------------------------------------------------------------------------
1 | use leptos::prelude::*;
2 |
3 | use crate::default::components::ui::button::{Button, ButtonVariant};
4 |
5 | #[component]
6 | pub fn ButtonLink() -> impl IntoView {
7 | view! {
8 |
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/book-examples/leptos/src/new_york/button/button_link.rs:
--------------------------------------------------------------------------------
1 | use leptos::prelude::*;
2 |
3 | use crate::new_york::components::ui::button::{Button, ButtonVariant};
4 |
5 | #[component]
6 | pub fn ButtonLink() -> impl IntoView {
7 | view! {
8 |
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/book-examples/yew/src/default/button/button_ghost.rs:
--------------------------------------------------------------------------------
1 | use yew::prelude::*;
2 |
3 | use crate::default::components::ui::button::{Button, ButtonVariant};
4 |
5 | #[function_component]
6 | pub fn ButtonGhost() -> Html {
7 | html! {
8 |
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/book-examples/yew/src/new_york/badge/badge_outline.rs:
--------------------------------------------------------------------------------
1 | use yew::prelude::*;
2 |
3 | use crate::new_york::components::ui::badge::{Badge, BadgeVariant};
4 |
5 | #[function_component]
6 | pub fn BadgeOutline() -> Html {
7 | html! {
8 | {"Outline"}
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/book-examples/yew/src/new_york/button/button_ghost.rs:
--------------------------------------------------------------------------------
1 | use yew::prelude::*;
2 |
3 | use crate::new_york::components::ui::button::{Button, ButtonVariant};
4 |
5 | #[function_component]
6 | pub fn ButtonGhost() -> Html {
7 | html! {
8 |
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/book-examples/leptos/src/default/badge/badge_outline.rs:
--------------------------------------------------------------------------------
1 | use leptos::prelude::*;
2 |
3 | use crate::default::components::ui::badge::{Badge, BadgeVariant};
4 |
5 | #[component]
6 | pub fn BadgeOutline() -> impl IntoView {
7 | view! {
8 | {"Outline"}
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/book-examples/leptos/src/new_york/badge/badge_outline.rs:
--------------------------------------------------------------------------------
1 | use leptos::prelude::*;
2 |
3 | use crate::new_york::components::ui::badge::{Badge, BadgeVariant};
4 |
5 | #[component]
6 | pub fn BadgeOutline() -> impl IntoView {
7 | view! {
8 | {"Outline"}
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/book-examples/leptos/src/new_york/button/button_ghost.rs:
--------------------------------------------------------------------------------
1 | use leptos::prelude::*;
2 |
3 | use crate::new_york::components::ui::button::{Button, ButtonVariant};
4 |
5 | #[component]
6 | pub fn ButtonGhost() -> impl IntoView {
7 | view! {
8 |
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/book-examples/yew/src/default/badge/badge_secondary.rs:
--------------------------------------------------------------------------------
1 | use yew::prelude::*;
2 |
3 | use crate::default::components::ui::badge::{Badge, BadgeVariant};
4 |
5 | #[function_component]
6 | pub fn BadgeSecondary() -> Html {
7 | html! {
8 | {"Secondary"}
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/book-examples/yew/src/default/button/button_outline.rs:
--------------------------------------------------------------------------------
1 | use yew::prelude::*;
2 |
3 | use crate::default::components::ui::button::{Button, ButtonVariant};
4 |
5 | #[function_component]
6 | pub fn ButtonOutline() -> Html {
7 | html! {
8 |
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/book-examples/yew/src/default/textarea/textarea_disabled.rs:
--------------------------------------------------------------------------------
1 | use yew::prelude::*;
2 |
3 | use crate::default::components::ui::textarea::Textarea;
4 |
5 | #[function_component]
6 | pub fn TextareaDisabled() -> Html {
7 | html! {
8 |
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/book-examples/yew/src/new_york/badge/badge_secondary.rs:
--------------------------------------------------------------------------------
1 | use yew::prelude::*;
2 |
3 | use crate::new_york::components::ui::badge::{Badge, BadgeVariant};
4 |
5 | #[function_component]
6 | pub fn BadgeSecondary() -> Html {
7 | html! {
8 | {"Secondary"}
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/book-examples/yew/src/new_york/textarea/textarea_disabled.rs:
--------------------------------------------------------------------------------
1 | use yew::prelude::*;
2 |
3 | use crate::new_york::components::ui::textarea::Textarea;
4 |
5 | #[function_component]
6 | pub fn TextareaDisabled() -> Html {
7 | html! {
8 |
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/packages/leptos/utils/src/lib.rs:
--------------------------------------------------------------------------------
1 | //! Leptos port of [shadcn/ui utils](https://ui.shadcn.com/docs/installation/manual#add-a-cn-helper).
2 | //!
3 | //! Utility for Tailwind CSS classes.
4 | //!
5 | //! See [the Rust shadcn/ui book](https://shadcn-ui.rustforweb.org/) for more documenation.
6 |
7 | pub mod default;
8 | pub mod new_york;
9 |
--------------------------------------------------------------------------------
/packages/yew/alert/src/lib.rs:
--------------------------------------------------------------------------------
1 | //! Yew port of [shadcn/ui Alert](https://ui.shadcn.com/docs/components/alert).
2 | //!
3 | //! Displays a callout for user attention.
4 | //!
5 | //! See [the Rust shadcn/ui book](https://shadcn-ui.rustforweb.org/components/alert.html) for more documenation.
6 |
7 | pub mod default;
8 | pub mod new_york;
9 |
--------------------------------------------------------------------------------
/book-examples/leptos/src/default/badge/badge_secondary.rs:
--------------------------------------------------------------------------------
1 | use leptos::prelude::*;
2 |
3 | use crate::default::components::ui::badge::{Badge, BadgeVariant};
4 |
5 | #[component]
6 | pub fn BadgeSecondary() -> impl IntoView {
7 | view! {
8 | {"Secondary"}
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/book-examples/leptos/src/default/button/button_outline.rs:
--------------------------------------------------------------------------------
1 | use leptos::prelude::*;
2 |
3 | use crate::default::components::ui::button::{Button, ButtonVariant};
4 |
5 | #[component]
6 | pub fn ButtonOutline() -> impl IntoView {
7 | view! {
8 |
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/book-examples/yew/src/new_york/button/button_outline.rs:
--------------------------------------------------------------------------------
1 | use yew::prelude::*;
2 |
3 | use crate::new_york::components::ui::button::{Button, ButtonVariant};
4 |
5 | #[function_component]
6 | pub fn ButtonOutline() -> Html {
7 | html! {
8 |
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/packages/leptos/alert/src/lib.rs:
--------------------------------------------------------------------------------
1 | //! Leptos port of [shadcn/ui Alert](https://ui.shadcn.com/docs/components/alert).
2 | //!
3 | //! Displays a callout for user attention.
4 | //!
5 | //! See [the Rust shadcn/ui book](https://shadcn-ui.rustforweb.org/components/alert.html) for more documenation.
6 |
7 | pub mod default;
8 | pub mod new_york;
9 |
--------------------------------------------------------------------------------
/packages/yew/card/src/lib.rs:
--------------------------------------------------------------------------------
1 | //! Yew port of [shadcn/ui Card](https://ui.shadcn.com/docs/components/card).
2 | //!
3 | //! Displays a card with header, content, and footer.
4 | //!
5 | //! See [the Rust shadcn/ui book](https://shadcn-ui.rustforweb.org/components/card.html) for more documenation.
6 |
7 | pub mod default;
8 | pub mod new_york;
9 |
--------------------------------------------------------------------------------
/book-examples/leptos/src/new_york/badge/badge_secondary.rs:
--------------------------------------------------------------------------------
1 | use leptos::prelude::*;
2 |
3 | use crate::new_york::components::ui::badge::{Badge, BadgeVariant};
4 |
5 | #[component]
6 | pub fn BadgeSecondary() -> impl IntoView {
7 | view! {
8 | {"Secondary"}
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/book-examples/leptos/src/new_york/button/button_outline.rs:
--------------------------------------------------------------------------------
1 | use leptos::prelude::*;
2 |
3 | use crate::new_york::components::ui::button::{Button, ButtonVariant};
4 |
5 | #[component]
6 | pub fn ButtonOutline() -> impl IntoView {
7 | view! {
8 |
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/book-examples/yew/src/default/badge/badge_destructive.rs:
--------------------------------------------------------------------------------
1 | use yew::prelude::*;
2 |
3 | use crate::default::components::ui::badge::{Badge, BadgeVariant};
4 |
5 | #[function_component]
6 | pub fn BadgeDestructive() -> Html {
7 | html! {
8 | {"Destructive"}
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/book-examples/yew/src/default/button/button_secondary.rs:
--------------------------------------------------------------------------------
1 | use yew::prelude::*;
2 |
3 | use crate::default::components::ui::button::{Button, ButtonVariant};
4 |
5 | #[function_component]
6 | pub fn ButtonSecondary() -> Html {
7 | html! {
8 |
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/book-examples/yew/src/new_york/badge/badge_destructive.rs:
--------------------------------------------------------------------------------
1 | use yew::prelude::*;
2 |
3 | use crate::new_york::components::ui::badge::{Badge, BadgeVariant};
4 |
5 | #[function_component]
6 | pub fn BadgeDestructive() -> Html {
7 | html! {
8 | {"Destructive"}
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/book-examples/yew/src/new_york/button/button_secondary.rs:
--------------------------------------------------------------------------------
1 | use yew::prelude::*;
2 |
3 | use crate::new_york::components::ui::button::{Button, ButtonVariant};
4 |
5 | #[function_component]
6 | pub fn ButtonSecondary() -> Html {
7 | html! {
8 |
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/book-examples/leptos/src/default/badge/badge_destructive.rs:
--------------------------------------------------------------------------------
1 | use leptos::prelude::*;
2 |
3 | use crate::default::components::ui::badge::{Badge, BadgeVariant};
4 |
5 | #[component]
6 | pub fn BadgeDestructive() -> impl IntoView {
7 | view! {
8 | {"Destructive"}
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/book-examples/leptos/src/default/button/button_secondary.rs:
--------------------------------------------------------------------------------
1 | use leptos::prelude::*;
2 |
3 | use crate::default::components::ui::button::{Button, ButtonVariant};
4 |
5 | #[component]
6 | pub fn ButtonSecondary() -> impl IntoView {
7 | view! {
8 |
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/book-examples/leptos/src/new_york/badge/badge_destructive.rs:
--------------------------------------------------------------------------------
1 | use leptos::prelude::*;
2 |
3 | use crate::new_york::components::ui::badge::{Badge, BadgeVariant};
4 |
5 | #[component]
6 | pub fn BadgeDestructive() -> impl IntoView {
7 | view! {
8 | {"Destructive"}
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/book-examples/leptos/src/new_york/button/button_secondary.rs:
--------------------------------------------------------------------------------
1 | use leptos::prelude::*;
2 |
3 | use crate::new_york::components::ui::button::{Button, ButtonVariant};
4 |
5 | #[component]
6 | pub fn ButtonSecondary() -> impl IntoView {
7 | view! {
8 |
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/book-examples/yew/src/default/button/button_destructive.rs:
--------------------------------------------------------------------------------
1 | use yew::prelude::*;
2 |
3 | use crate::default::components::ui::button::{Button, ButtonVariant};
4 |
5 | #[function_component]
6 | pub fn ButtonDestructive() -> Html {
7 | html! {
8 |
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/packages/leptos/card/src/lib.rs:
--------------------------------------------------------------------------------
1 | //! Leptos port of [shadcn/ui Card](https://ui.shadcn.com/docs/components/card).
2 | //!
3 | //! Displays a card with header, content, and footer.
4 | //!
5 | //! See [the Rust shadcn/ui book](https://shadcn-ui.rustforweb.org/components/card.html) for more documenation.
6 |
7 | pub mod default;
8 | pub mod new_york;
9 |
--------------------------------------------------------------------------------
/packages/yew/label/src/lib.rs:
--------------------------------------------------------------------------------
1 | //! Yew port of [shadcn/ui Label](https://ui.shadcn.com/docs/components/label).
2 | //!
3 | //! Renders an accessible label associated with controls.
4 | //!
5 | //! See [the Rust shadcn/ui book](https://shadcn-ui.rustforweb.org/components/label.html) for more documenation.
6 |
7 | pub mod default;
8 | pub mod new_york;
9 |
--------------------------------------------------------------------------------
/book-examples/leptos/src/default/button/button_destructive.rs:
--------------------------------------------------------------------------------
1 | use leptos::prelude::*;
2 |
3 | use crate::default::components::ui::button::{Button, ButtonVariant};
4 |
5 | #[component]
6 | pub fn ButtonDestructive() -> impl IntoView {
7 | view! {
8 |
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/book-examples/yew/src/new_york/button/button_destructive.rs:
--------------------------------------------------------------------------------
1 | use yew::prelude::*;
2 |
3 | use crate::new_york::components::ui::button::{Button, ButtonVariant};
4 |
5 | #[function_component]
6 | pub fn ButtonDestructive() -> Html {
7 | html! {
8 |
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/packages/yew/badge/src/lib.rs:
--------------------------------------------------------------------------------
1 | //! Yew port of [shadcn/ui Badge](https://ui.shadcn.com/docs/components/badge).
2 | //!
3 | //! Displays a badge or a component that looks like a badge.
4 | //!
5 | //! See [the Rust shadcn/ui book](https://shadcn-ui.rustforweb.org/components/badge.html) for more documenation.
6 |
7 | pub mod default;
8 | pub mod new_york;
9 |
--------------------------------------------------------------------------------
/packages/yew/separator/src/lib.rs:
--------------------------------------------------------------------------------
1 | //! Yew port of [shadcn/ui Separator](https://ui.shadcn.com/docs/components/separator).
2 | //!
3 | //! Visually or semantically separates content.
4 | //!
5 | //! See [the Rust shadcn/ui book](https://shadcn-ui.rustforweb.org/components/separator.html) for more documenation.
6 |
7 | pub mod default;
8 | pub mod new_york;
9 |
--------------------------------------------------------------------------------
/book-examples/leptos/src/new_york/button/button_destructive.rs:
--------------------------------------------------------------------------------
1 | use leptos::prelude::*;
2 |
3 | use crate::new_york::components::ui::button::{Button, ButtonVariant};
4 |
5 | #[component]
6 | pub fn ButtonDestructive() -> impl IntoView {
7 | view! {
8 |
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/packages/leptos/badge/src/lib.rs:
--------------------------------------------------------------------------------
1 | //! Leptos port of [shadcn/ui Badge](https://ui.shadcn.com/docs/components/badge).
2 | //!
3 | //! Displays a badge or a component that looks like a badge.
4 | //!
5 | //! See [the Rust shadcn/ui book](https://shadcn-ui.rustforweb.org/components/badge.html) for more documenation.
6 |
7 | pub mod default;
8 | pub mod new_york;
9 |
--------------------------------------------------------------------------------
/packages/yew/avatar/src/lib.rs:
--------------------------------------------------------------------------------
1 | //! Yew port of [shadcn/ui Avatar](https://ui.shadcn.com/docs/components/avatar).
2 | //!
3 | //! An image element with a fallback for representing the user.
4 | //!
5 | //! See [the Rust shadcn/ui book](https://shadcn-ui.rustforweb.org/components/avatar.html) for more documenation.
6 |
7 | pub mod default;
8 | pub mod new_york;
9 |
--------------------------------------------------------------------------------
/packages/yew/button/src/lib.rs:
--------------------------------------------------------------------------------
1 | //! Yew port of [shadcn/ui Button](https://ui.shadcn.com/docs/components/button).
2 | //!
3 | //! Displays a button or a component that looks like a button.
4 | //!
5 | //! See [the Rust shadcn/ui book](https://shadcn-ui.rustforweb.org/components/button.html) for more documenation.
6 |
7 | pub mod default;
8 | pub mod new_york;
9 |
--------------------------------------------------------------------------------
/packages/yew/skeleton/src/lib.rs:
--------------------------------------------------------------------------------
1 | //! Yew port of [shadcn/ui Skeleton](https://ui.shadcn.com/docs/components/skeleton).
2 | //!
3 | //! Use to show a placeholder while content is loading.
4 | //!
5 | //! See [the Rust shadcn/ui book](https://shadcn-ui.rustforweb.org/components/skeleton.html) for more documenation.
6 |
7 | pub mod default;
8 | pub mod new_york;
9 |
--------------------------------------------------------------------------------
/packages/leptos/button/src/lib.rs:
--------------------------------------------------------------------------------
1 | //! Leptos port of [shadcn/ui Button](https://ui.shadcn.com/docs/components/button).
2 | //!
3 | //! Displays a button or a component that looks like a button.
4 | //!
5 | //! See [the Rust shadcn/ui book](https://shadcn-ui.rustforweb.org/components/button.html) for more documenation.
6 |
7 | pub mod default;
8 | pub mod new_york;
9 |
--------------------------------------------------------------------------------
/packages/yew/aspect-ratio/src/lib.rs:
--------------------------------------------------------------------------------
1 | //! Yew port of [shadcn/ui Aspect Ratio](https://ui.shadcn.com/docs/components/aspect-ratio).
2 | //!
3 | //! Displays content within a desired ratio.
4 | //!
5 | //! See [the Rust shadcn/ui book](https://shadcn-ui.rustforweb.org/components/aspect-ratio.html) for more documenation.
6 |
7 | pub mod default;
8 | pub mod new_york;
9 |
--------------------------------------------------------------------------------
/packages/yew/input/src/lib.rs:
--------------------------------------------------------------------------------
1 | //! Yew port of [shadcn/ui Input](https://ui.shadcn.com/docs/components/input).
2 | //!
3 | //! Displays a form input field or a component that looks like an input field.
4 | //!
5 | //! See [the Rust shadcn/ui book](https://shadcn-ui.rustforweb.org/components/input.html) for more documenation.
6 |
7 | pub mod default;
8 | pub mod new_york;
9 |
--------------------------------------------------------------------------------
/packages/yew/pagination/src/lib.rs:
--------------------------------------------------------------------------------
1 | //! Yew port of [shadcn/ui Pagination](https://ui.shadcn.com/docs/components/pagination).
2 | //!
3 | //! Pagination with page navigation, next and previous links.
4 | //!
5 | //! See [the Rust shadcn/ui book](https://shadcn-ui.rustforweb.org/components/pagination.html) for more documenation.
6 |
7 | pub mod default;
8 | pub mod new_york;
9 |
--------------------------------------------------------------------------------
/packages/yew/switch/src/lib.rs:
--------------------------------------------------------------------------------
1 | //! Yew port of [shadcn/ui Switch](https://ui.shadcn.com/docs/components/switch).
2 | //!
3 | //! A control that allows the user to toggle between checked and not checked.
4 | //!
5 | //! See [the Rust shadcn/ui book](https://shadcn-ui.rustforweb.org/components/switch.html) for more documenation.
6 |
7 | pub mod default;
8 | pub mod new_york;
9 |
--------------------------------------------------------------------------------
/packages/yew/textarea/src/lib.rs:
--------------------------------------------------------------------------------
1 | //! Yew port of [shadcn/ui Textarea](https://ui.shadcn.com/docs/components/textarea).
2 | //!
3 | //! Displays a form textarea or a component that looks like a textarea.
4 | //!
5 | //! See [the Rust shadcn/ui book](https://shadcn-ui.rustforweb.org/components/textarea.html) for more documenation.
6 |
7 | pub mod default;
8 | pub mod new_york;
9 |
--------------------------------------------------------------------------------
/packages/registry/Cargo.toml:
--------------------------------------------------------------------------------
1 | [package]
2 | name = "shadcn-registry"
3 | description = "Rust port of shadcn registry."
4 | publish = false
5 |
6 | authors.workspace = true
7 | edition.workspace = true
8 | license.workspace = true
9 | repository.workspace = true
10 | version.workspace = true
11 |
12 | [dependencies]
13 | serde.workspace = true
14 | serde_with = "3.10.0"
15 |
--------------------------------------------------------------------------------
/packages/yew/breadcrumb/src/lib.rs:
--------------------------------------------------------------------------------
1 | //! Yew port of [shadcn/ui Breadcrumb](https://ui.shadcn.com/docs/components/breadcrumb).
2 | //!
3 | //! Displays the path to the current resource using a hierarchy of links.
4 | //!
5 | //! See [the Rust shadcn/ui book](https://shadcn-ui.rustforweb.org/components/breadcrumb.html) for more documenation.
6 |
7 | pub mod default;
8 | pub mod new_york;
9 |
--------------------------------------------------------------------------------
/book-examples/yew/src/default/button/button_with_icon.rs:
--------------------------------------------------------------------------------
1 | use lucide_yew::Mail;
2 | use yew::prelude::*;
3 |
4 | use crate::default::components::ui::button::Button;
5 |
6 | #[function_component]
7 | pub fn ButtonWithIcon() -> Html {
8 | html! {
9 |
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/packages/leptos/utils/Cargo.toml:
--------------------------------------------------------------------------------
1 | [package]
2 | name = "shadcn-ui-leptos-utils"
3 | description = "Leptos port of shadcn/ui utils."
4 | publish = false
5 |
6 | authors.workspace = true
7 | edition.workspace = true
8 | license.workspace = true
9 | repository.workspace = true
10 | version.workspace = true
11 |
12 | [dependencies]
13 | # leptos.workspace = true
14 | # tailwind_fuse.workspace = true
15 |
--------------------------------------------------------------------------------
/book-examples/leptos/src/default/button/button_with_icon.rs:
--------------------------------------------------------------------------------
1 | use leptos::prelude::*;
2 |
3 | use crate::default::components::ui::button::Button;
4 |
5 | #[component]
6 | pub fn ButtonWithIcon() -> impl IntoView {
7 | view! {
8 |
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/book-examples/yew/src/new_york/button/button_with_icon.rs:
--------------------------------------------------------------------------------
1 | use radix_yew_icons::EnvelopeOpenIcon;
2 | use yew::prelude::*;
3 |
4 | use crate::new_york::components::ui::button::Button;
5 |
6 | #[function_component]
7 | pub fn ButtonWithIcon() -> Html {
8 | html! {
9 |
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/packages/registry/src/registry_blocks.rs:
--------------------------------------------------------------------------------
1 | use std::{collections::HashMap, sync::LazyLock};
2 |
3 | use crate::schema::{FrameworkName, Registry};
4 |
5 | pub static BLOCKS: LazyLock> = LazyLock::new(|| {
6 | HashMap::from([
7 | (FrameworkName::Dioxus, vec![]),
8 | (FrameworkName::Leptos, vec![]),
9 | (FrameworkName::Yew, vec![]),
10 | ])
11 | });
12 |
--------------------------------------------------------------------------------
/packages/registry/src/registry_charts.rs:
--------------------------------------------------------------------------------
1 | use std::{collections::HashMap, sync::LazyLock};
2 |
3 | use crate::schema::{FrameworkName, Registry};
4 |
5 | pub static CHARTS: LazyLock> = LazyLock::new(|| {
6 | HashMap::from([
7 | (FrameworkName::Dioxus, vec![]),
8 | (FrameworkName::Leptos, vec![]),
9 | (FrameworkName::Yew, vec![]),
10 | ])
11 | });
12 |
--------------------------------------------------------------------------------
/packages/registry/src/registry_hooks.rs:
--------------------------------------------------------------------------------
1 | use std::{collections::HashMap, sync::LazyLock};
2 |
3 | use crate::schema::{FrameworkName, Registry};
4 |
5 | pub static HOOKS: LazyLock> = LazyLock::new(|| {
6 | HashMap::from([
7 | (FrameworkName::Dioxus, vec![]),
8 | (FrameworkName::Leptos, vec![]),
9 | (FrameworkName::Yew, vec![]),
10 | ])
11 | });
12 |
--------------------------------------------------------------------------------
/packages/registry/src/registry_examples.rs:
--------------------------------------------------------------------------------
1 | use std::{collections::HashMap, sync::LazyLock};
2 |
3 | use crate::schema::{FrameworkName, Registry};
4 |
5 | pub static EXAMPLES: LazyLock> = LazyLock::new(|| {
6 | HashMap::from([
7 | (FrameworkName::Dioxus, vec![]),
8 | (FrameworkName::Leptos, vec![]),
9 | (FrameworkName::Yew, vec![]),
10 | ])
11 | });
12 |
--------------------------------------------------------------------------------
/book-examples/yew/src/default/breadcrumb/breadcrumb_responsive.rs:
--------------------------------------------------------------------------------
1 | use yew::prelude::*;
2 |
3 | // use crate::default::components::ui::breadcrumb::{
4 | // Breadcrumb, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage,
5 | // BreadcrumbSeparator,
6 | // };
7 |
8 | #[function_component]
9 | pub fn BreadcrumbResponsive() -> Html {
10 | html! {
11 | // TODO
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/book-examples/yew/src/new_york/breadcrumb/breadcrumb_responsive.rs:
--------------------------------------------------------------------------------
1 | use yew::prelude::*;
2 |
3 | // use crate::default::components::ui::breadcrumb::{
4 | // Breadcrumb, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage,
5 | // BreadcrumbSeparator,
6 | // };
7 |
8 | #[function_component]
9 | pub fn BreadcrumbResponsive() -> Html {
10 | html! {
11 | // TODO
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/packages/shadcn/Cargo.toml:
--------------------------------------------------------------------------------
1 | [package]
2 | name = "shadcn"
3 | description = "Rust port of shadcn CLI."
4 |
5 | authors.workspace = true
6 | edition.workspace = true
7 | license.workspace = true
8 | repository.workspace = true
9 | version.workspace = true
10 |
11 | [dependencies]
12 | anyhow.workspace = true
13 | clap = { version = "4.5.4", features = ["cargo", "derive"] }
14 | spinners = "4.1.1"
15 | tokio.workspace = true
16 |
--------------------------------------------------------------------------------
/book-examples/yew/src/default/button/button_loading.rs:
--------------------------------------------------------------------------------
1 | use lucide_yew::LoaderCircle;
2 | use yew::prelude::*;
3 |
4 | use crate::default::components::ui::button::Button;
5 |
6 | #[function_component]
7 | pub fn ButtonLoading() -> Html {
8 | html! {
9 |
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/book-examples/yew/src/default/label.rs:
--------------------------------------------------------------------------------
1 | #[allow(clippy::module_inception)]
2 | mod label;
3 |
4 | use yew::prelude::*;
5 | use yew_router::prelude::*;
6 |
7 | #[derive(Clone, PartialEq, Routable)]
8 | pub enum LabelRoute {
9 | #[at("/default/")]
10 | Root,
11 | }
12 |
13 | pub fn render(route: LabelRoute) -> Html {
14 | match route {
15 | LabelRoute::Root => html! { },
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/book-examples/yew/src/default/table.rs:
--------------------------------------------------------------------------------
1 | #[allow(clippy::module_inception)]
2 | mod table;
3 |
4 | use yew::prelude::*;
5 | use yew_router::prelude::*;
6 |
7 | #[derive(Clone, PartialEq, Routable)]
8 | pub enum TableRoute {
9 | #[at("/default/")]
10 | Root,
11 | }
12 |
13 | pub fn render(route: TableRoute) -> Html {
14 | match route {
15 | TableRoute::Root => html! { },
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/book-examples/yew/src/new_york/button/button_loading.rs:
--------------------------------------------------------------------------------
1 | use radix_yew_icons::ReloadIcon;
2 | use yew::prelude::*;
3 |
4 | use crate::new_york::components::ui::button::Button;
5 |
6 | #[function_component]
7 | pub fn ButtonLoading() -> Html {
8 | html! {
9 |
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/book-examples/yew/src/new_york/label.rs:
--------------------------------------------------------------------------------
1 | #[allow(clippy::module_inception)]
2 | mod label;
3 |
4 | use yew::prelude::*;
5 | use yew_router::prelude::*;
6 |
7 | #[derive(Clone, PartialEq, Routable)]
8 | pub enum LabelRoute {
9 | #[at("/new-york/")]
10 | Root,
11 | }
12 |
13 | pub fn render(route: LabelRoute) -> Html {
14 | match route {
15 | LabelRoute::Root => html! { },
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/book-examples/yew/src/new_york/table.rs:
--------------------------------------------------------------------------------
1 | #[allow(clippy::module_inception)]
2 | mod table;
3 |
4 | use yew::prelude::*;
5 | use yew_router::prelude::*;
6 |
7 | #[derive(Clone, PartialEq, Routable)]
8 | pub enum TableRoute {
9 | #[at("/new-york/")]
10 | Root,
11 | }
12 |
13 | pub fn render(route: TableRoute) -> Html {
14 | match route {
15 | TableRoute::Root => html! { },
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/book-examples/yew/src/default/avatar.rs:
--------------------------------------------------------------------------------
1 | #[allow(clippy::module_inception)]
2 | mod avatar;
3 |
4 | use yew::prelude::*;
5 | use yew_router::prelude::*;
6 |
7 | #[derive(Clone, PartialEq, Routable)]
8 | pub enum AvatarRoute {
9 | #[at("/default/")]
10 | Root,
11 | }
12 |
13 | pub fn render(route: AvatarRoute) -> Html {
14 | match route {
15 | AvatarRoute::Root => html! { },
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/book-examples/yew/src/default/switch/switch.rs:
--------------------------------------------------------------------------------
1 | use yew::prelude::*;
2 |
3 | use crate::default::components::ui::{label::Label, switch::Switch};
4 |
5 | #[function_component]
6 | pub fn SwitchDemo() -> Html {
7 | html! {
8 |
9 |
10 |
11 |
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/book-examples/yew/src/new_york/switch/switch.rs:
--------------------------------------------------------------------------------
1 | use yew::prelude::*;
2 |
3 | use crate::new_york::components::ui::{label::Label, switch::Switch};
4 |
5 | #[function_component]
6 | pub fn SwitchDemo() -> Html {
7 | html! {
8 |
9 |
10 |
11 |
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/book/theme/theme.js:
--------------------------------------------------------------------------------
1 | window.addEventListener('message', (event) => {
2 | if (!event.data.mdbookTrunk) {
3 | return;
4 | }
5 |
6 | const data = event.data.mdbookTrunk;
7 | const iframe = Array.from(document.getElementsByTagName('iframe')).find(
8 | (iframe) => iframe.contentWindow === event.source
9 | );
10 | if (iframe) {
11 | iframe.style.height = `${data.height}px`;
12 | }
13 | });
14 |
--------------------------------------------------------------------------------
/book-examples/leptos/src/default/button/button_loading.rs:
--------------------------------------------------------------------------------
1 | use leptos::prelude::*;
2 | use lucide_leptos::LoaderCircle;
3 |
4 | use crate::default::components::ui::button::Button;
5 |
6 | #[component]
7 | pub fn ButtonLoading() -> impl IntoView {
8 | view! {
9 |
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/book-examples/leptos/src/new_york/button/button_with_icon.rs:
--------------------------------------------------------------------------------
1 | use leptos::prelude::*;
2 | // use radix_leptos_icons::EnvelopeOpenIcon;
3 |
4 | use crate::new_york::components::ui::button::Button;
5 |
6 | #[component]
7 | pub fn ButtonWithIcon() -> impl IntoView {
8 | view! {
9 |
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/book-examples/yew/src/default/avatar/avatar.rs:
--------------------------------------------------------------------------------
1 | use yew::prelude::*;
2 |
3 | use crate::default::components::ui::avatar::{Avatar, AvatarFallback, AvatarImage};
4 |
5 | #[function_component]
6 | pub fn AvatarDemo() -> Html {
7 | html! {
8 |
9 |
10 | {"CN"}
11 |
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/book-examples/yew/src/default/input/input_file.rs:
--------------------------------------------------------------------------------
1 | use yew::prelude::*;
2 |
3 | use crate::default::components::ui::{input::Input, label::Label};
4 |
5 | #[function_component]
6 | pub fn InputFile() -> Html {
7 | html! {
8 |
9 |
10 |
11 |
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/book-examples/yew/src/new_york/avatar.rs:
--------------------------------------------------------------------------------
1 | #[allow(clippy::module_inception)]
2 | mod avatar;
3 |
4 | use yew::prelude::*;
5 | use yew_router::prelude::*;
6 |
7 | #[derive(Clone, PartialEq, Routable)]
8 | pub enum AvatarRoute {
9 | #[at("/new-york/")]
10 | Root,
11 | }
12 |
13 | pub fn render(route: AvatarRoute) -> Html {
14 | match route {
15 | AvatarRoute::Root => html! { },
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/book-examples/yew/src/new_york/avatar/avatar.rs:
--------------------------------------------------------------------------------
1 | use yew::prelude::*;
2 |
3 | use crate::new_york::components::ui::avatar::{Avatar, AvatarFallback, AvatarImage};
4 |
5 | #[function_component]
6 | pub fn AvatarDemo() -> Html {
7 | html! {
8 |
9 |
10 | {"CN"}
11 |
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/book-examples/yew/src/default/button/button_icon.rs:
--------------------------------------------------------------------------------
1 | use lucide_yew::ChevronRight;
2 | use yew::prelude::*;
3 |
4 | use crate::default::components::ui::button::{Button, ButtonSize, ButtonVariant};
5 |
6 | #[function_component]
7 | pub fn ButtonIcon() -> Html {
8 | html! {
9 |
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/book-examples/yew/src/new_york/input/input_file.rs:
--------------------------------------------------------------------------------
1 | use yew::prelude::*;
2 |
3 | use crate::new_york::components::ui::{input::Input, label::Label};
4 |
5 | #[function_component]
6 | pub fn InputFile() -> Html {
7 | html! {
8 |
9 |
10 |
11 |
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/book-examples/yew/src/default/textarea/textarea_with_button.rs:
--------------------------------------------------------------------------------
1 | use yew::prelude::*;
2 |
3 | use crate::default::components::ui::{button::Button, textarea::Textarea};
4 |
5 | #[function_component]
6 | pub fn TextareaWithButton() -> Html {
7 | html! {
8 |
9 |
10 |
11 |
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/book-examples/yew/src/new_york/textarea/textarea_with_button.rs:
--------------------------------------------------------------------------------
1 | use yew::prelude::*;
2 |
3 | use crate::new_york::components::ui::{button::Button, textarea::Textarea};
4 |
5 | #[function_component]
6 | pub fn TextareaWithButton() -> Html {
7 | html! {
8 |
9 |
10 |
11 |
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/book-examples/leptos/src/default/button/button_icon.rs:
--------------------------------------------------------------------------------
1 | use leptos::prelude::*;
2 | use lucide_leptos::ChevronRight;
3 |
4 | use crate::default::components::ui::button::{Button, ButtonSize, ButtonVariant};
5 |
6 | #[component]
7 | pub fn ButtonIcon() -> impl IntoView {
8 | view! {
9 |
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/book-examples/yew/src/default/button/button_as_child.rs:
--------------------------------------------------------------------------------
1 | use yew::prelude::*;
2 |
3 | use crate::default::components::ui::button::{Button, ButtonChildProps};
4 |
5 | #[function_component]
6 | pub fn ButtonAsChild() -> Html {
7 | html! {
8 |