Code Monkey home page Code Monkey logo

Comments (4)

jrmoulton avatar jrmoulton commented on May 27, 2024 2

Widgets in Floem are highly composable. The current dropdown widget is built to not lock you into any required style. If it was any simpler there would be aspects of the widget that you couldn't control.

It might be a slight inconvenience to dial in the dropdown view just the way you want for a small project but once you've done it once you can just move that implementation to it's own function and reuse it. This is very practical even for small-medium projects.

An opinionated widget would awesome but that sort of thing belongs in a separate widgets/components crate that provides a consistent look across all widgets and can build on the un-opinionated widgets that Floem provides.

We also could provide our own opinionated widget but it wouldn't replace the un-opinionated one.

from floem.

panekj avatar panekj commented on May 27, 2024 1

for example the user code is required to provide a chevron icon for it?

It's not required, as the directory name should suggest, it's an example, list works fine without an icon.

and implement the default look manually?

I'm unsure what do you refer to as default look (since the links you gave point only to the example code file), below example works just as fine and isn't complicated

pub fn dropdown_view() -> impl View {
    let show_dropdown = create_rw_signal(false);

    form::form({
        (form_item("Dropdown".to_string(), 120.0, move || {
            dropdown(
                move || Values::Three,
                move |item| label(move || item).any(),
                Values::iter(),
                |item| label(move || item).any(),
            )
            .show_list(move || show_dropdown.get())
            .on_accept(move |_val| show_dropdown.set(false))
        }),)
    })
}

from floem.

habics avatar habics commented on May 27, 2024 1

Sorry guys closing the issue now, I didn't realize you can use simpler code than the one in the examples to create it, thank you for your awesome work on floem :)

from floem.

jrmoulton avatar jrmoulton commented on May 27, 2024 1

Thanks and now worries. Happy you're enjoying :)

from floem.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.