Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added bootstrap badge component #522

Merged
merged 1 commit into from
Mar 19, 2024

Conversation

aharnisch
Copy link

Implementation of the bootstrap badge component.

Testcode:

val counter = ObservableValue(0)

h1 {
    +"Badge in Header "
    badge("New")
}

h1 { +"Badge in Button" }
button("Clicked Me") {
    badge("to create mail")
    this.onClick {
        counter.setState(counter.getState() + 1)
    }
}

div {
    this.marginTop = 20.px
    button("New Mail") {
        badge(bsColor = BsColor.DANGERBG, position = BadgePosition.TOP_RIGHT).bind(counter) {
            if (it != 0) this.content = it.toString()
        }
    }
}

h1 { +"Position" }
div {
    margin = 20.px
    button("") {
        width = 100.px
        height = 100.px
        badge("TL", position = BadgePosition.TOP_LEFT)
        badge("TC", position = BadgePosition.TOP_CENTER)
        badge("TR", position = BadgePosition.TOP_RIGHT)
        badge("BL", position = BadgePosition.BOTTOM_LEFT)
        badge("BC", position = BadgePosition.BOTTOM_CENTER)
        badge("BR", position = BadgePosition.BOTTOM_RIGHT)
        badge("ML", position = BadgePosition.MIDDLE_LEFT)
        badge("MC", position = BadgePosition.MIDDLE_CENTER)
        badge("MR", position = BadgePosition.MIDDLE_RIGHT)
    }
}

@rjaros rjaros merged commit a427a56 into rjaros:master Mar 19, 2024
1 check failed
@rjaros
Copy link
Owner

rjaros commented Mar 19, 2024

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants