| Crates.io | lbc |
| lib.rs | lbc |
| version | 0.1.15 |
| created_at | 2025-11-21 20:51:06.380731+00 |
| updated_at | 2026-01-01 04:02:32.047693+00 |
| description | A Leptos component library based on the Bulma CSS framework. |
| homepage | |
| repository | |
| max_upload_size | |
| id | 1944248 |
| size | 602,406 |
LBC is a collection of reusable, declarative UI components for the Leptos web framework, styled with the Bulma CSS library. The goal is to provide ergonomic, type‑safe components that feel natural in Leptos while mapping closely to Bulma’s design system and ecosystem.
lbc_catalog) demonstrating usage, patterns, and best practices.src/ — the lbc library crate (this is what you depend on).lbc_catalog/ — a small catalog/demo application showing all components in action (CSR, built with Trunk).dist/, target/ — build artifacts (gitignored).The catalog is the fastest way to explore the components locally.
Prerequisites:
wasm32-unknown-unknown targetInstall prerequisites:
rustup target add wasm32-unknown-unknown
cargo install trunk
Run the catalog app:
cd lbc_catalog
trunk serve --open
This will build the WASM binary and open the catalog in your browser. The catalog includes CDN links for Bulma, Font Awesome, and a few Bulma JS plugins used by some components.
Notes:
leptos = { features = ["csr"] }).index.html with data-trunk tags to compile and serve the app.lbc in your Leptos appAdd a dependency (use a path dependency locally, or crates.io when published):
[dependencies]
leptos = { version = "0.8", features = ["csr"] }
lbc = { git= "https://github.com/goodidea-kp/lbc" } # in the catalog; in your app, use the appropriate path or version
Import the prelude to get the most commonly used components and helpers:
use lbc::prelude::*;
Example: a simple Card with Content
use leptos::*;
use lbc::prelude::*;
#[component]
pub fn ExampleCard() -> impl IntoView {
view! {
<Card>
<CardHeader>"My header"</CardHeader>
<CardImage>
<figure class="image is-4by3">
<img src="https://picsum.photos/800/600" alt="" />
</figure>
</CardImage>
<CardContent>
<Content>
<p>"Hello from LBC!"</p>
</Content>
</CardContent>
<CardFooter>
<a class="card-footer-item">"Action"</a>
</CardFooter>
</Card>
}
}
lbc::preludeThe prelude consolidates the most frequently used items across elements, components, layout, and forms so you can use lbc::prelude::*; and start building.
Components:
Tabs, AlignmentPanel, PanelBlock, PanelTabsPagination, PaginationItem, PaginationItemType, PaginationEllipsisNavbar, NavbarItem, NavbarDropdown, NavbarDivider, NavbarFixed, NavbarMenuContextModal, ModalCard, ModalCloserProvider, ModalCloserContextMessage, MessageHeader, MessageBodyMenu, MenuLabel, MenuListDropdownCard, CardHeader, CardImage, CardContent, CardFooterCalendarBreadcrumb, BreadcrumbSeparator, BreadcrumbSizeAccordions, AccordionItemElements:
Block, BoxButton, ButtonColor, ButtonsContentNotificationListDeleteIcon, IconAlignmentImageProgressTableTag, TagColor, TagsTitle, Subtitle, HeaderSizeLayout:
Columns, Column, ColumnSizeContainerFooterHero, HeroSizeLevel, LevelLeft, LevelRight, LevelItemMedia, MediaLeft, MediaRight, MediaContentSection, SectionSizeTile, TileSize, TileCtxForm (controlled components):
Field (with LabelSize, GroupedAlign, AddonsAlign)ControlInput, InputTypeTextareaSelect, MultiSelectCheckboxRadioFileAutoCompleteUtilities:
Size (shared sizing utility)Tip: See src/lib.rs and the module mod.rs files for the exact public surface and newly added items.
LBC components assume Bulma CSS is available globally. The catalog’s index.html shows a working baseline:
bulma-calendar@creativebulma/bulma-tagsinputbulma-accordionYou can include these via CDN or bundle them yourself. If your app doesn’t require a given plugin, you can omit it.
The catalog includes many example pages under lbc_catalog/src/, e.g.:
components/accordion_example_page.rscomponents/breadcrumb_example_page.rscomponents/buttons_example_page.rscomponents/calendar_example_page.rscomponents/card_example_page.rscomponents/dropdown_example_page.rselements/content_example_page.rselements/colors_example_page.rsfooter_example_page.rs, level_example_page.rs, etc.
Explore the code there for end‑to‑end snippets of real usage.
Regular Rust code for components (no macros beyond Leptos #[component]).
Prefer small, focused modules mirroring Bulma’s structure.
Form components are controlled: state is held by the parent and passed via signals/props.
For local development, run the catalog with Trunk and iterate.
Specify your chosen license here (e.g., MIT/Apache‑2.0 dual license). Add LICENSE file accordingly.