MCPcopy Index your code
hub / github.com/dioxus-community/lookbook

github.com/dioxus-community/lookbook @main

Chat with this repo
repository ↗ · DeepWiki ↗ · + Follow
34 symbols 41 edges 11 files 1 documented · 3%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

Lookbook

UI preview framework for Dioxus

Crates.io version docs.rs docs CI status Demo
/// To-Do Task.
#[preview]
pub fn TaskPreview(
    /// Label of the task.
    #[lookbook(default = "Ice skating")]
    label: String,

    /// Content of the task.
    #[lookbook(default = "Central Park")]
    content: String,

    /// List of tags.
    #[lookbook(default = vec![String::from("A")])]
    tags: Json<Vec<String>>,
) -> Element {
    rsx!(
        div {
            h4 { "{label}" }
            p { "{content}" }
            div { { tags.0.iter().map(|tag| rsx!(li { "{tag}" })) } }
        }
    )
}

#[component]
fn app() -> Element {
    rsx!(LookBook {
        home: |()| rsx!("Home"),
        previews: [TaskPreview]
    })
}

fn main() {
    dioxus::launch(app)
}
## Usage First add Lookbook as a dependency to your project.
cargo add lookbook@v0.2.0-alpha.1
Then create a preview like the one above and add it to a lookbook.
fn app() -> Element {
    rsx!(LookBook {
        home: |()| rsx!("Home"),
        previews: [TaskPreview]
    })
}

fn main() {
    dioxus::launch(app)
}
Run with `dx serve`! ## Supported platforms - [x] Web - [ ] Desktop/mobile https://github.com/matthunz/lookbook/issues/5 - [ ] Blitz https://github.com/matthunz/lookbook/issues/6 ## Running examples Run the examples with `dx serve --example {name}`.

Extension points exported contracts — how you extend this code

Control (Interface)
A controllable property. [2 implementers]
src/control.rs

Core symbols most depended-on inside this repo

render_with_location
called by 2
macros/src/lib.rs
collect_docs
called by 1
macros/src/lib.rs
use_prefix
called by 1
src/prefixed_route.rs
register
called by 1
src/lib.rs
preview
called by 0
macros/src/lib.rs
Markdown
called by 0
src/markdown.rs
fmt
called by 0
src/prefixed_route.rs
from_str
called by 0
src/prefixed_route.rs

Shape

Function 18
Method 10
Class 4
Enum 1
Interface 1

Languages

Rust100%

Modules by API surface

src/control.rs8 symbols
src/prefixed_route.rs7 symbols
src/lib.rs6 symbols
macros/src/lib.rs3 symbols
examples/task.rs3 symbols
src/ui/wrap.rs2 symbols
src/ui/pane.rs2 symbols
src/ui/look_book.rs1 symbols
src/ui/look.rs1 symbols
src/markdown.rs1 symbols

For agents

$ claude mcp add lookbook \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact