Getting Started
SolidBase wraps your SolidStart config rather than wrapping Start itself, so you can add SolidBase to most existing Start projects or create a new one.
Creating a New Project
Follow Start's getting started guide
to create a new project.
We'd recommend using the basic
preset as it includes @solidjs/router
,
and recommend against the with-mdx
preset as SolidBase will provide MDX spport for you.
Adding SolidBase to Your Project
Install @kobalte/solidbase
using your preferred package manager.
In your project's app.config
, wrap the config being passed to defineConfig
with withSolidBase
.
This will configure SolidBase with the default theme.
Add the SolidBaseRoot
component to the root
of your project's Router
.
If your router already has a root
component, you can wrap it with SolidBaseRoot
.
To provide the lang
and data-theme
attributes to the html
element during SSR,
spread getHtmlProps()
onto it in entry-server
:
SolidBase prerenders your pages by default,
so data-theme
will probably be incorrect in the initial HTML.
To account for this,
a small script will automatically be injected to correct the theme before the page is rendered.
Your project is now setup with the default SolidBase theme!
Last updated: 11/15/24, 3:46 AM