To use Bento components, you must import the required stylesheets and wrap your application in the BentoProvider.
- Import Styles: Import
index.css (required for core functionality) and defaultTheme.css (optional, provides the standard look). These should be imported once, typically at the root of the application. - BentoProvider: Wrap your app with
BentoProvider. This context provider is mandatory for Bento components to function. - Localization: Pass
defaultMessages to the BentoProvider to provide standard text for repetitive UI elements (like 'Close' or 'Loading...') across components.
import "@buildo/bento-design-system/index.css";
import "@buildo/bento-design-system/defaultTheme.css";
import { defaultMessages } from "@buildo/bento-design-system/defaultMessages/en";
import { BentoProvider, Title } from "@buildo/bento-design-system";
function App() {
return (
<BentoProvider defaultMessages={defaultMessages}>
<Title size="large">Hello, World!</Title>
</BentoProvider>
);
}