How 42angouleme/dioxus-tw-components works
Main Components of the System
• Dioxus Integration & Bootstrap:
• Bootstrap mechanism in src/bootstrap (and its use in the main app as shown in the README).
• How the library must be initialized in a Dioxus application (through DioxusTwComponentsBootstrap).
• Component Hierarchy:
• That there are three layers (Atoms, Molecules, Organisms) organized under src/components.
• Encompass additional component directories like templates, pages, hooks, and theme support.
• Custom Macros:
• Dioxus-tw-components-macro and dioxus-tw-components-sorttable-macro directories that extend or generate component code.
• Styling & CSS Integration:
• External connection with Tailwind’s compiler through specified CSS variables and import instructions.
• Build & Versioning:
• Cargo configuration (Cargo.toml at top-level and within the macros) as an integration point.
• Existence of GitHub workflows for CI (located in .github/workflows) that may interact with build/deploy pipelines.
Relationships and Interactions
• The bootstrap component (under src/bootstrap) initializes global settings to let the components work properly.
• The CSS and Tailwind configuration work side-by-side with the components to ensure styling is consistent and customizable.
• Custom macros are used to add compile-time functionality or generate code that extends basic component properties.
• The layout can be depicted in layers: Underlying integration, then core library (components, hooks, theme) and finally, the macros as extensions.
Architectural Patterns or Design Principles
• Modularity and Reusability: The code is organized into atoms, molecules, and organisms representing a design system hierarchy (inspired by atomic design).
• Separation of Concerns: Styling (CSS) is separated from component logic (Rust in src/components).
• Extensibility: Custom derive macros allow for extensibility in UI components.
• Declarative UI: Components are designed to be composable in a Dioxus/React-like manner.
Including Technologies, Frameworks, and Libraries
• Dioxus: The fundamental rendering and component system.
• TailwindCSS: The styling engine with its configuration and custom variable support.
• Rust & Cargo: For package management and compiling the components library.
• GitHub Actions (workflows): To ensure CI integration and testing.