-
A set of accessible and unstyled components built for design systems and rich interfaces.
-
Usable in server-rendered applications and Lustre server components, as well as client-rendered apps.
How an interface or component works and how it looks are two challenging but distinct aspects of a design system that are often conflated in ui libraries. We think it's better for everyone if these two things are decoupled, so lustre/ui is a "headless" library focused on functionality that leaves styling up to application and design system authors.
We've designed lustre/ui with a few goals in mind:
-
Make it easy to build accessible interfaces.
-
Provide a primitive HTML-like API that more-opinionated abstractions can be built on top of.
Note: Lustre UI is currently in pre-release and under active development. If you have any feedback or suggestions, please open an issue or reach out on the Gleam discord.
Lustre UI is published on Hex. To use it in your project with Gleam:
gleam add lustre_ui@1.0.0-rc.1Ensure the required CSS is rendered in your apps by serving the stylesheet found
in the priv/static directory of this package!
In order for lustre/ui to work correctly you need to do two things:
-
Include the lustre/ui stylesheet in your app. This can be found in the
priv/staticdirectory for this package and can either be served by your backend (in case of a full stack application) or copied or otherwise included frombuild/packages/lustre_ui/priv/staticin your frontend application. -
Construct a theme from the
lustre/ui/thememodule and render the dynamic style element by callingtheme.to_styleor wrapping your application's view function usingtheme.inject.
Both of these steps must be done in order for the components to render correctly. The base stylesheet includes the necessary CSS rules and classes for every component, and your theme defines the design tokens and CSS variables used by those components.
Lustre is mostly built by just me, Hayleigh, around two jobs. If you'd like to support my work, you can sponsor me on GitHub.
Contributions are also very welcome! If you've spotted a bug, or would like to suggest a feature, please open an issue or a pull request.